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: improve test-async-hooks-http-parser-destroy #27319

Closed
wants to merge 4 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Apr 19, 2019

Improve reporting in test-async-hooks-http-parser-destroy when failing.

Before, failures looked like this (edited slightly to conform to our
commit message 72-char line length restriction):

The expression evaluated to a falsy value:
assert.ok(destroyedIds.indexOf(createdAsyncId) >= 0)

Now, you get a slightly better idea of what's up. (Is it missing one ID?
More than one? All of them?):

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected ... Lines skipped

  [
    156,
...
    757,
-   761,
    765
  ]
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@Trott Trott added http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests. async_hooks Issues and PRs related to the async hooks subsystem. labels Apr 19, 2019
@nodejs-github-bot
Copy link
Collaborator

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 20, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Trott Trott removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 20, 2019
if (createdIds.includes(asyncId)) {
// Work around https://github.com/nodejs/node/issues/26961.
// Remove the next line when #26961 is fixed.
if (!destroyedIds.includes(asyncId))
Copy link
Member

Choose a reason for hiding this comment

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

I would rather not include this part and instead mark this test as flaky. Otherwise we might forget about it and the test will silently work while it should fail.

The failure indicates that we have a bug somewhere that we should fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see what you're saying and I'm definitely sympathetic. The problem is that with the changes in this PR, the test will basically fail 100% of the time. And I'm generally not OK with marking a test "flaky" as a workaround for a test that fails on every run. But the change is (IMO) a genuine improvement. It makes the checks more thorough (which is why it increases the failure rate dramatically).

I guess the solution everyone can support would be to fix the underlying bug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that ece5073 landed, let's see if that fixes the remaining issues here and if I can remove this workaround.... Going to run CI with this and then again without it....

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like HTTPPARSER ids never show up now. I imagine that's unintended....

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it totally was intentional. Guess I need to update the test to use HTTPINCOMINGMESSAGE or something like that. Or maybe the test can/should be removed entirely?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably the thing to do is to simply not filter the asyncIDs at all. If V8 compiling ever finishes for me locally, I'll try that out....

Copy link
Member Author

Choose a reason for hiding this comment

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

Alas, it did not appear to fix the bug. IDs show up in destroy without showing up in create. But I should at least update the test to use HTTPINCOMINGMESSAGE.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member Author

Trott commented Apr 23, 2019

Passes everywhere except when run in a worker (using tools/test.py --worker:

not ok 186 parallel/test-async-hooks-http-parser-destroy
  ---
  duration_ms: 5.423
  severity: fail
  exitcode: 1
  stack: |-
    
    events.js:173
          throw er; // Unhandled 'error' event
          ^
    AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
    + actual - expected ... Lines skipped
    
      [
        158,
    ...
        487,
    -   491,
    -   495,
    -   499,
    -   503,
    -   507
      ]
        at process.checkOnExit (/home/iojs/build/workspace/node-test-commit-custom-suites-freestyle/test/parallel/test-async-hooks-http-parser-destroy.js:61:10)
        at process.emit (events.js:201:15)
    Emitted 'error' event at:
        at Worker.[kOnErrorMessage] (internal/worker.js:161:10)
        at Worker.[kOnMessage] (internal/worker.js:171:37)
        at MessagePort.<anonymous> (internal/worker.js:104:57)
        at MessagePort.emit (events.js:196:13)
        at MessagePort.onmessage (internal/worker/io.js:68:8)
  ...

@Trott
Copy link
Member Author

Trott commented Apr 23, 2019

Missing some destroy calls when run in a worker....

Improve reporting in test-async-hooks-http-parser-destroy when failing.

Before, failures looked like this (edited slightly to conform to our
commit message 72-char line length restriction):

    The expression evaluated to a falsy value:
    assert.ok(destroyedIds.indexOf(createdAsyncId) >= 0)

Now, you get a slightly better idea of what's up. (Is it missing one ID?
More than one? All of them?):

    AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
    + actual - expected ... Lines skipped

      [
        156,
    ...
        757,
    -   761,
        765
      ]
@Trott
Copy link
Member Author

Trott commented May 3, 2019

Now that #26961 has landed, this can be unblocked/unstalled. I've rebased, removed the workaround for #26961, and I think this is ready to go? Re-reviews would be helpful. @addaleax @joyeecheung

@nodejs-github-bot

This comment has been minimized.

@Trott
Copy link
Member Author

Trott commented May 3, 2019

Argh! Still fails with --worker....

@Trott
Copy link
Member Author

Trott commented May 3, 2019

OK, fixed for workers!

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 4, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member Author

Trott commented May 5, 2019

Landed in 11e1e00

@Trott Trott closed this May 5, 2019
Trott added a commit to Trott/io.js that referenced this pull request May 5, 2019
Improve reporting in test-async-hooks-http-parser-destroy when failing.

Before, failures looked like this (edited slightly to conform to our
commit message 72-char line length restriction):

    The expression evaluated to a falsy value:
    assert.ok(destroyedIds.indexOf(createdAsyncId) >= 0)

Now, you get a slightly better idea of what's up. (Is it missing one ID?
More than one? All of them?):

    AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
    + actual - expected ... Lines skipped

      [
        156,
    ...
        757,
    -   761,
        765
      ]

PR-URL: nodejs#27319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this pull request May 5, 2019
Improve reporting in test-async-hooks-http-parser-destroy when failing.

Before, failures looked like this (edited slightly to conform to our
commit message 72-char line length restriction):

    The expression evaluated to a falsy value:
    assert.ok(destroyedIds.indexOf(createdAsyncId) >= 0)

Now, you get a slightly better idea of what's up. (Is it missing one ID?
More than one? All of them?):

    AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
    + actual - expected ... Lines skipped

      [
        156,
    ...
        757,
    -   761,
        765
      ]

PR-URL: #27319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@targos targos mentioned this pull request May 6, 2019
@Trott Trott deleted the simplify-test branch January 13, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants