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

test: test-timers-unrefd-interval-still-fires.js flaky on smartOS #4559

Closed
MylesBorins opened this issue Jan 7, 2016 · 6 comments
Closed
Labels
smartos Issues and PRs related to the SmartOS platform. test Issues and PRs related to the tests. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

Comments

@MylesBorins
Copy link
Contributor

Seeing flaky results in LTS

https://ci.nodejs.org/job/node-test-commit-smartos/813/

# [FAIL] Interval fired 5/5 times.
# /home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14
#   throw new Error('Test timed out. keepOpen was not canceled.');
#   ^
# 
# Error: Test timed out. keepOpen was not canceled.
#     at null._onTimeout (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14:9)
#     at Timer.listOnTimeout (timers.js:92:15)

https://ci.nodejs.org/job/node-test-commit-smartos/810/

not ok 757 test-timers-unrefd-interval-still-fires.js
# [FAIL] Interval fired 4/5 times.
# /home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14
#   throw new Error('Test timed out. keepOpen was not canceled.');
#   ^
# 
# Error: Test timed out. keepOpen was not canceled.
#     at null._onTimeout (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14:9)
#     at Timer.listOnTimeout (timers.js:92:15)

Passes on job 811 and 812 though.

Running one more time to see if it fails again

https://ci.nodejs.org/job/node-test-commit-smartos/814/

@mscdex mscdex added timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. test Issues and PRs related to the tests. smartos Issues and PRs related to the SmartOS platform. labels Jan 7, 2016
@Trott
Copy link
Member

Trott commented Jan 7, 2016

Current version fails stress test: https://ci.nodejs.org/job/node-stress-single-test/307/nodes=smartos14-64/console

This would appear to be a fulfillment of the prophecy of @misterdjules at #3550 (comment).

I've refactored the test to not rely on an arbitrary timeout as it is not a performance benchmark but a functionality test designed to check for a very specific bug.

The refactored test passes the stress test: https://ci.nodejs.org/job/node-stress-single-test/311/nodes=smartos14-64/console

PR: #4561

@Fishrock123
Copy link
Contributor

One of the aforementioned failures is particularly interesting:

# [FAIL] Interval fired 5/5 times.
# /home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14
#   throw new Error('Test timed out. keepOpen was not canceled.');
#   ^
# 
# Error: Test timed out. keepOpen was not canceled.
#     at null._onTimeout (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/parallel/test-timers-unrefd-interval-still-fires.js:14:9)
#     at Timer.listOnTimeout (timers.js:92:15)

As far as I can tell, it isn't possible for this to happen. If it's 5/5 the timeout that throws that error will already be cancelled...

@Trott
Copy link
Member

Trott commented Jan 7, 2016

@Fishrock123 Perhaps a race condition caused by the clearTimeout(keepOpen) being in a setImmediate() rather than just called directly? I'm not sure that's possible, but since the impossible is happening, something is up.

@Fishrock123
Copy link
Contributor

Oh hmmm.

@Trott I can't find where I suggested that to be added, I forget why that was. It should be removed, I think. (The setImmediate())

@Trott
Copy link
Member

Trott commented Jan 7, 2016

@Fishrock123 My first attempt at a fix for this was to just remove the setImmediate() (and convert arrow functions to ES5-compatible functions) and leave everything else: b954d83

It was still flaky when stress tested, though:
https://ci.nodejs.org/job/node-stress-single-test/308/nodes=smartos14-64/console

But it did get rid of the 5/5. The failures were all 4/5, 3/5...

The control stress test (against master) showed 5/5 failures: https://ci.nodejs.org/job/node-stress-single-test/307/nodes=smartos14-64/console

So yeah, it looks like the setImmediate() caused the 5/5 weirdness. (But fixing that did not fix the test flakiness.)

At least that mystery is solved...

Trott added a commit to Trott/io.js that referenced this issue Jan 9, 2016
@Trott Trott closed this as completed in e071894 Jan 11, 2016
@Trott
Copy link
Member

Trott commented Jan 11, 2016

e071894 should workaround the issue for you, @thealphanerd. There's a more thorough fix that will hopefully land soon, but that should resolve this issue for you if you land it on LTS.

Trott added a commit to Trott/io.js that referenced this issue Jan 11, 2016
Remove arbitrary timeout duration. This is a functionality test and not
a performance benchmark. Rely on test runner timeout.

Confirmed that the test (with ES6-isms removed) hangs/times out in Node
0.10.34 (which has the bug that this test is supposed to catch) and
passes in 0.10.35 (which has the fix). So that is good.

Fixes: nodejs#4559
MylesBorins pushed a commit that referenced this issue Jan 11, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: #4559
PR-URL: #4599
Reviewed-By: Johan Bergström <[email protected]>
MylesBorins pushed a commit that referenced this issue Jan 12, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: #4559
PR-URL: #4599
Reviewed-By: Johan Bergström <[email protected]>
MylesBorins pushed a commit that referenced this issue Jan 28, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: #4559
PR-URL: #4599
Reviewed-By: Johan Bergström <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 11, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: #4559
PR-URL: #4599
Reviewed-By: Johan Bergström <[email protected]>
MylesBorins pushed a commit to MylesBorins/node that referenced this issue Feb 11, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: nodejs#4559
PR-URL: nodejs#4599
Reviewed-By: Johan Bergström <[email protected]>
MylesBorins pushed a commit to MylesBorins/node that referenced this issue Feb 15, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: nodejs#4559
PR-URL: nodejs#4599
Reviewed-By: Johan Bergström <[email protected]>
scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
Remove unnecessary `setImmediate()` that causes a minor race condition.
Stop the test after 3 occurrences rather than 5 to allow for slower
hosts running the test in parallel with other tests.

Fixes: nodejs#4559
PR-URL: nodejs#4599
Reviewed-By: Johan Bergström <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smartos Issues and PRs related to the SmartOS platform. test Issues and PRs related to the tests. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
4 participants