Skip to content

test: fix flaky test-fs-promises-file-handle-close - #31687

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:fix-test-fs-promises-file-handle-close
Closed

addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:fix-test-fs-promises-file-handle-close

Conversation

@addaleax

@addaleax addaleax commented Feb 7, 2020

Copy link
Copy Markdown
Member

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 Node.js core tests and test infrastructure. label Feb 7, 2020
@addaleax addaleax added flaky-test Issues and PRs involving tests that fail intermittently in CI. fs Issues and PRs related to file-system APIs and the fs module. labels Feb 7, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

nodejs-github-bot commented Feb 7, 2020 •

Copy link
Copy Markdown
Collaborator

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

@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Feb 8, 2020
@addaleax

Copy link
Copy Markdown
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 with CI started, the required approvals, and no outstanding review comments. flaky-test Issues and PRs involving tests that fail intermittently in CI. fs Issues and PRs related to file-system APIs and the fs module. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants