mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-28 15:50:26 +08:00
ServiceManagement test: reduce test flake.
ExpectProcessIsRunning() goes to a lot of trouble to deal with the flaky {CTL_KERN, KERN_PROCARGS2} API exposed by ProcessArgumentsForPID(). It retries that call inside an inner loop until it succeeds, because it may fail while a process is mid-exec(). Once it succeeds, it should use the argv it obtained. Waiting for success and then attempting to call ProcessArgumentsForPID() again to get argv can be flaky when the first attempt succeeds because it’s pre-exec(), and the second one catches the process in the middle of the exec() and fails. The existence of the inner loop was intended to protect against this problem, and the subsequent call outside of the inner loop appears to be left behind from before the inner loop existed. It should have been removed when the inner loop was added. TEST=util_test ServiceManagement.SubmitRemoveJob R=rsesek@chromium.org Review URL: https://codereview.chromium.org/644473005
This commit is contained in:
parent
c182be95a2
commit
7669b33010
@ -58,7 +58,6 @@ void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
|
||||
} while (inner_tries--);
|
||||
ASSERT_TRUE(success);
|
||||
|
||||
ASSERT_TRUE(ProcessArgumentsForPID(pid, &job_argv));
|
||||
ASSERT_FALSE(job_argv.empty());
|
||||
if (job_argv.back() == last_arg) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user