Skip to content

test: don't fail http2 abort test if 'data' is called multiple times - #21925

Closed
rubys wants to merge 1 commit into
nodejs:masterfrom
rubys:test-http2-abort-data-twice
Closed

test: don't fail http2 abort test if 'data' is called multiple times#21925
rubys wants to merge 1 commit into
nodejs:masterfrom
rubys:test-http2-abort-data-twice

Conversation

@rubys

Copy link
Copy Markdown
Member

I'm seeing a regression in make test on master on macOS High Sierra Version 10.13.5. The error I'm seeing is:

=== release test-http2-respond-with-file-connection-abort === Path: parallel/test-http2-respond-with-file-connection-abort
Mismatched <anonymous> function calls. Expected exactly 1, actual 2.
at Object.exports.mustCall (/Users/rubys/git/node/test/common/index.js:427:10)
at Http2Server.server.listen.common.mustCall (/Users/rubys/git/node/test/parallel/test-http2-respond-with-file-connection-abort.js:25:25)
at Http2Server.<anonymous> (/Users/rubys/git/node/test/common/index.js:467:15)
at Object.onceWrapper (events.js:273:13)
at Http2Server.emit (events.js:182:13)
at emitListeningNT (net.js:1370:10)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
(node:20069) ExperimentalWarning: The http2 module is an experimental API.
Command: out/Release/node /Users/rubys/git/node/test/parallel/test-http2-respond-with-file-connection-abort.js
[02:54|% 100|+ 2354|- 1]: Done 

It seems that the test case is assuming that a data event will be emitted exactly once, but I see no reason why that should be guaranteed to be the case.

With this fix, the new results are:

[02:55|% 100|+ 2355|- 0]: Done 
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@Trott

Copy link
Copy Markdown
Member

Another approach would be to use .once() instead of .on(). That way destroy() and close() don't get called more than once. But I'm 👍 on the approach taken here too.

@Trott

Copy link
Copy Markdown
Member

@nodejs/http2

@Trott

Copy link
Copy Markdown
Member

@TrottTrott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 22, 2018
@mcollina

Copy link
Copy Markdown
Member

Flaky test on OS X, I've hit resume build.

@Trott

Copy link
Copy Markdown
Member

Resumed build is https://ci.nodejs.org/job/node-test-pull-request/15976/ (and green).

@Trott
Trottforce-pushed the test-http2-abort-data-twice branch from 165e78e to ef32a01CompareJuly 23, 2018 18:47
@Trott

Copy link
Copy Markdown
Member

Had to resolve a merge conflict. Restarting CI again: https://ci.nodejs.org/job/node-test-pull-request/15979/

@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 in 838001d

mcollina pushed a commit that referenced this pull request Jul 25, 2018
PR-URL: #21925
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request Jul 26, 2018
PR-URL: #21925
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@targostargos mentioned this pull request Jul 31, 2018
@kjinkjin mentioned this pull request Sep 19, 2018
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@rubys@Trott@mcollina@apapirovski@jasnell@benjamingr@lpinca@cjihrig@trivikr