Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate flaky test test-child-process-spawnsync #2470

Closed
joaocgreis opened this issue Aug 20, 2015 · 2 comments
Closed

Investigate flaky test test-child-process-spawnsync #2470

joaocgreis opened this issue Aug 20, 2015 · 2 comments
Labels
build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.

Comments

@joaocgreis
Copy link
Member

Examples of failures:

@joaocgreis joaocgreis added build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests. labels Aug 20, 2015
@Trott
Copy link
Member

Trott commented Aug 25, 2015

If I'm understanding the test correctly, the part of the test that is flaky is actually invalid. It checks to see if the function passed to setTimeout() executes in the same second as call to spawnSync() finishes. This will not always necessarily be the case, and the test will only get flakier if more things are added to it. (There are two other test cases below the flaky one.)

There's already an assertion to confirm that the spawnSync() ends before setTimeout() runs, so I'll submit a PR to remove the check altogether rather than do something like convert the timestamps to nanoseconds since start and make sure the one set by setTimeout() is greater than the one set by spawnSync().

Trott added a commit to Trott/io.js that referenced this issue Aug 25, 2015
The test had checked that a timer fired within a period after
spawnSync() returns. The result was a test that sometimes was
flaky.

Because there's no guarantee of how long a timer will take
before running, remove the check. There is a check that the
timer runs after spawnSync() so that is sufficient.

Fixes: nodejs#2470
Trott added a commit that referenced this issue Aug 25, 2015
The test had checked that a timer fired within a period after
spawnSync() returns. The result was a test that sometimes was
flaky.

Because there's no guarantee of how long a timer will take
before running, remove the check. There is a check that the
timer runs after spawnSync() so that is sufficient.

PR-URL: #2535
Fixes: #2470
Reviewed-By: Ben Noordhuis <[email protected]>
@Trott
Copy link
Member

Trott commented Aug 25, 2015

Fixed in 7e63eb7 / #2535

@Trott Trott closed this as completed Aug 25, 2015
Trott added a commit that referenced this issue Aug 26, 2015
The test had checked that a timer fired within a period after
spawnSync() returns. The result was a test that sometimes was
flaky.

Because there's no guarantee of how long a timer will take
before running, remove the check. There is a check that the
timer runs after spawnSync() so that is sufficient.

PR-URL: #2535
Fixes: #2470
Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

2 participants