test: fix multiple expectedWarnings bug#19766
Closed
danbev wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
Commit 8fb4ea9 ("test: add deprecation code to expectWarning") did not take into account that the same warning could be expected multiple times. This bug was discovered in nodejs#18138 and this commit adds a fix for this issue. Refs: nodejs#18138
Contributor
Author
Contributor
Author
node-test-commit failure looks unrelated01:37:40 not ok 2111 sequential/test-inspector-scriptparsed-context
01:37:40 ---
01:37:40 duration_ms: 0.508
01:37:40 severity: fail
01:37:40 stack: |-
01:37:40 [test] Connecting to a child Node process
01:37:40 [test] Testing /json/list
01:37:40 [err] Debugger listening on ws://127.0.0.1:60830/9b378dbe-1113-4be4-999e-312be19407fe
01:37:40 [err] For help see https://nodejs.org/en/docs/inspector
01:37:40 [err]
01:37:40 ... |
tniessen
approved these changes
Apr 3, 2018
Member
tniessen
left a comment
There was a problem hiding this comment.
LGTM to fix the problem at hand, but the function still doesn't seem to work as expected. Thanks for the quick fix!
| @@ -631,7 +631,7 @@ function expectWarning(name, expected) { | |||
| // Remove a warning message after it is seen so that we guarantee that we | |||
| // get each message only once. | |||
Member
There was a problem hiding this comment.
This comment seems to contradict this change.
| @@ -631,7 +631,7 @@ function expectWarning(name, expected) { | |||
| // Remove a warning message after it is seen so that we guarantee that we | |||
| // get each message only once. | |||
| map.delete(expected); | |||
Member
There was a problem hiding this comment.
This seems to be a bug as well, expected is the array of all warnings, and this call returns false.
jasnell
approved these changes
Apr 3, 2018
4 tasks
Contributor
Author
danbev
added a commit
that referenced
this pull request
Apr 6, 2018
Commit 8fb4ea9 ("test: add deprecation code to expectWarning") did not take into account that the same warning could be expected multiple times. This bug was discovered in #18138 and this commit adds a fix for this issue. PR-URL: #19766 Refs: #18138 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
|
Thank you, @danbev! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit 8fb4ea9 ("test: add deprecation code to expectWarning") did
not take into account that the same warning could be expected multiple
times. This bug was discovered in
#18138 and this commit adds a fix for
this issue.
Refs: #18138
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes