Skip to content

test: fix flaky test-http2-session-timeout - #15338

Closed
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-fix-test-http2-session-timeout
Closed

test: fix flaky test-http2-session-timeout#15338
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-fix-test-http2-session-timeout

Conversation

@apapirovski

@apapirovskiapapirovski commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

This is an alternative solution to #15328. Increases server timeout, reduces frequency of calls and unbinds timeout after runs are done in order to avoid race conditions.

cc @Trott@mcollina@tniessen

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Sep 11, 2017
@apapirovski

apapirovski commented Sep 11, 2017

Copy link
Copy Markdown
ContributorAuthor

I was able to run tools/test.py -j 96 --repeat 192 test/parallel/test-http2-session-timeout.js with no failures (repeatedly) so this should be safe.

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from a6b0f34 to c8e3767CompareSeptember 11, 2017 11:21
@mscdexmscdex added the http2 Issues or PRs related to the http2 subsystem. label Sep 11, 2017
@mcollina

Copy link
Copy Markdown
Member

@tniessentniessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM if CI passes.

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

We should be able to run a CI stress test now that @TimothyGu's patch landed. Could someone pull the trigger, please?

@mcollina

mcollina commented Sep 13, 2017

Copy link
Copy Markdown
Member

@mcollina

Copy link
Copy Markdown
Member

Both of them failed all times, so maybe I got something wrong in kicking off the job. Can someone else have a look and start it again?

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from c8e3767 to 3bd0870CompareSeptember 13, 2017 11:24
@apapirovski

Copy link
Copy Markdown
ContributorAuthor

It behaved as if the patch to the test runner didn't land. Not sure why that would be.

(I've rebased this just in case but I can't imagine it's running my version of the test runner... is it?)

@Trott

Copy link
Copy Markdown
Member

(I've rebased this just in case but I can't imagine it's running my version of the test runner... is it?)

I think it is (or was). It was using ref refs/pull/15338/head and doesn't appear to do a rebase.

@Trott

Copy link
Copy Markdown
Member

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Well, that explains that. Thanks @Trott

@Trott

Copy link
Copy Markdown
Member

Whoops, those stress tests aren't really valid because they aren't running things concurrently. (Glad their green, though.)

I'll kick off some more in a minute.

@Trott

Copy link
Copy Markdown
Member

Oh, this should include Fixes: #15326 as metadata. This is a note to whoever lands this. :-D

@Trott

Copy link
Copy Markdown
Member

Stress test on freebsd10-64 where it has been observed to fail:

This PR (should be green): https://ci.nodejs.org/job/node-stress-single-test/1417/

master (should be red): https://ci.nodejs.org/job/node-stress-single-test/1418/

@Trott

Trott commented Sep 14, 2017

Copy link
Copy Markdown
Member

The stress test still fails with these changes. (EDIT: I stopped the one for this PR after 76 failures in 76 runs.)

For comparison, here's a stress test on #15328: https://ci.nodejs.org/job/node-stress-single-test/1419/nodes=freebsd10-64/console EDIT: Argh, looks like I need to rebase to run a single test as well. Did that now, so let's try again: https://ci.nodejs.org/job/node-stress-single-test/1420/nodes=freebsd10-64/console

If that stress test passes but you still want the overall changes in this PR, hopefully the solution is to simply change the timeout values from 500 and 50 to 1200 and 10. Not a great solution as there's still a race condition, but one that (probably) won't be triggered on our CI or in most developer test runs.

If that stress test fails too, then it's time to look into things some more...

@apapirovski

apapirovski commented Sep 14, 2017

Copy link
Copy Markdown
ContributorAuthor

The problem with comparing this to the other PR is that it doesn't actually test the timeout condition, as per my comment there. It only runs 40 requests 10ms (400ms total) apart and the timeout is 1200ms.

I'll see what can be done to fix this PR.

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from 3bd0870 to c47516cCompareSeptember 14, 2017 10:53
@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Ok, changed up some more stuff. Should be able to handle concurrency better now. Can we run this again? Thanks so much!

@mcollina

Copy link
Copy Markdown
Member

@apapirovski

apapirovski commented Sep 14, 2017

Copy link
Copy Markdown
ContributorAuthor

Is there a margin of failure we consider acceptable for stress tests? Looks like it's failing about 15-20% of the time now.

I'm guessing if I bump up the timeout to something like 5000 and the calls to, say, 800 then it'll probably be fine on that system but it makes the test unnecessarily long on all platforms. Not sure if that's a big deal or not.

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from c47516c to 65e5a0bCompareSeptember 14, 2017 12:26
@apapirovski

apapirovski commented Sep 14, 2017

Copy link
Copy Markdown
ContributorAuthor

New version is up, 5000 & 800 now. If this doesn't do it then I don't know...

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from 65e5a0b to 3103f89CompareSeptember 14, 2017 12:29
@apapirovski

apapirovski commented Sep 14, 2017

Copy link
Copy Markdown
ContributorAuthor

@mcollina I just checked the CI and the commit it's testing is the one from the other PR. I reverted my changes since I don't think they got tested.

@Trott

Trott commented Sep 14, 2017

Copy link
Copy Markdown
Member

So here are the important parameters to use to kick of a CI stress test for this PR:

  • GIT_REMOTE_REF should be refs/pull/15338/head
  • RUN_TESTS should be -j 96 --repeat 192 parallel/test-http2-session-timeout. If you don't include the -j and --repeat parameters, then the stress test runs one test at a time over and over, as if it was in sequential. This is fine for tests that are flaky for reasons other than concurrency, but this one is (like most timer-based race conditions) greatly impacted by how many other tests are running. 96 is way more than CI will typically run, but this is a way to make sure the problem is really solved. :-D
  • RUN_TIMES leave at 100 because each one of those will run the test 192 times, so that means you're running the test 19,200 rimwa, which is plenty.
  • Choose freebsd10-64 from the RUN_LABEL drop-down as that's where we've seen it fail in CI.

@Trott

Copy link
Copy Markdown
Member

@Trott

Copy link
Copy Markdown
Member

Still failing. I think moving the test from test/parallel to test/sequential may be the way to go. Given the reliance on timers, I don't think there's any way to make this test not prone to race conditions.

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

A lot closer this time but yeah, still failing. Will think about it a bit and see if I can revise it in any way, if not we'll just have to move it to sequential. Sorry for the hassle, everyone.

@jasnell

Copy link
Copy Markdown
Member

No worries at all @apapirovski !

@TrottTrott mentioned this pull request Sep 16, 2017
2 tasks
@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from 3103f89 to 0c22399CompareSeptember 16, 2017 12:25
@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Updated to move to sequential for now. Will revisit later potentially but all the http timeout tests are there so it might not be possible anyway.

@Trott

Copy link
Copy Markdown
Member

Question that can be ignored if you wish in the interest of getting the fix landed quickly: Since it's in sequential, does it make sense to go back to a 200ms timeout or at least reduce it somewhat from 2000 to speed up the test?

@Trott

Copy link
Copy Markdown
Member

@apapirovski

apapirovski commented Sep 16, 2017

Copy link
Copy Markdown
ContributorAuthor

@Trott Yeah, we can definitely reduce it. I'll put it at 200 for the server & 20 for the call. Did you want to run the CI on the updated version once I put it up or is that run above enough?

Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.
Fixes: nodejs#15326
@Trott

Copy link
Copy Markdown
Member

Did you want to run the CI on the updated version once I put it up

Yeah, let's run CI again after any changes.

@apapirovski
apapirovskiforce-pushed the patch-fix-test-http2-session-timeout branch from 0c22399 to 0113f2eCompareSeptember 16, 2017 14:36
@apapirovski

apapirovski commented Sep 16, 2017

Copy link
Copy Markdown
ContributorAuthor

Ok, timing updates are available to test now. Thanks @Trott!

@Trott

Copy link
Copy Markdown
Member

@mcollina

Copy link
Copy Markdown
Member

CI (again): https://ci.nodejs.org/job/node-test-pull-request/10118/

The failure seemed unrelated, but it would be better to check.

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Failure looks unrelated, this is the test that failed parallel/test-listen-fd-ebadf.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina

Copy link
Copy Markdown
Member

Landed as de51717.

mcollina pushed a commit that referenced this pull request Sep 18, 2017
Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.
Fixes: #15326
PR-URL: #15338
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@apapirovski
apapirovski deleted the patch-fix-test-http2-session-timeout branch September 19, 2017 14:00
jasnell pushed a commit that referenced this pull request Sep 20, 2017
Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.
Fixes: #15326
PR-URL: #15338
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.
Fixes: nodejs/node#15326
PR-URL: nodejs/node#15338
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.
Fixes: nodejs/node#15326
PR-URL: nodejs/node#15338
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http2Issues or PRs related to the http2 subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@apapirovski@mcollina@Trott@jasnell@tniessen@hiroppy@mscdex@MylesBorins@nodejs-github-bot