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: fix flaky test-fs-promises-file-handle-close #31687

Closed

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Feb 7, 2020

Sometimes, the expected warnings were not emitted.
To harden the test:

  • Instead of relying on a timeout that raced against the file being
    opened, wait until the file is opened and then schedule GC
    after that.
  • Explicitly keep the event loop alive for one turn to make sure
    the warning is being seen.

Example failure: https://ci.nodejs.org/job/node-test-commit-linux-containered/17920/nodes=ubuntu1804_sharedlibs_debug_x64/testReport/junit/(root)/test/parallel_test_fs_promises_file_handle_close/

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

Sometimes, the expected warnings were not emitted.
To harden the test:

- Instead of relying on a timeout that raced against the file being
  opened, wait until the file is opened and then schedule GC
  after that.
- Explicitly keep the event loop alive for one turn to make sure
  the warning is being seen.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 7, 2020
@addaleax addaleax added flaky-test Issues and PRs related to the tests with unstable failures on the CI. fs Issues and PRs related to the fs subsystem / file system. labels Feb 7, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Feb 7, 2020

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

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 8, 2020
@addaleax
Copy link
Member Author

Landed in 5100e84

@addaleax addaleax closed this Feb 10, 2020
addaleax added a commit that referenced this pull request Feb 10, 2020
Sometimes, the expected warnings were not emitted.
To harden the test:

- Instead of relying on a timeout that raced against the file being
  opened, wait until the file is opened and then schedule GC
  after that.
- Explicitly keep the event loop alive for one turn to make sure
  the warning is being seen.

PR-URL: #31687
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@addaleax addaleax deleted the fix-test-fs-promises-file-handle-close branch February 10, 2020 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. flaky-test Issues and PRs related to the tests with unstable failures on the CI. fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants