Sitelet https://github.com/nodejs/node/issues/40728
Skip to content

Investigate flaky test-fs-watch-non-recursive on Windows #40728

Description

@targos
  • Test: test-fs-watch-non-recursive
  • Platform: Windows
  • Console Output:
node:assert:171
  throw err;
  ^

AssertionError [ERR_ASSERTION]: function should not have been called at C:\workspace\node-test-binary-windows-js-suites\node\test\pummel\test-fs-watch-non-recursive.js:43
called with arguments: 'change', 'testsubdir'
    at FSWatcher.mustNotCall (C:\workspace\node-test-binary-windows-js-suites\node\test\common\index.js:479:12)
    at FSWatcher.emit (node:events:390:28)
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:212:12) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Activity

  1. added
    flaky-testIssues and PRs involving tests that fail intermittently in CI.
    windowsIssues and PRs related to the Windows platform.
    on Nov 5, 2021
  2. joyeecheung commented on Nov 8, 2021

    @joyeecheung
    Member

    It seems this first appears in nodejs/reliability#92, the referenced PRs don't seem to be related so I suspect it's an issue with the test.

  3. targos commented on Nov 8, 2021

    @targos
    MemberAuthor

    I'm am totally unable to make this test pass on my Windows machine, even if I increase the timeouts.
    Maybe the issue is with some recent Windows update?

  4. added
    fsIssues and PRs related to file-system APIs and the fs module.
    on Nov 8, 2021
  5. Trott commented on Nov 9, 2021

    @Trott
    Member

    @nodejs/platform-windows

  6. Flarna commented on Nov 14, 2021

    @Flarna
    Member

    It seems that the creation of file testsubdir/watch.txt changes the modification time of testsubdir - which seems correct to me.

    I wonder that this test ever passed.

    Adding e.g. fs.writeFileSync(filepath, 'init'); before starting the watcher avoids this and test passes on my machine. But I'm not sure if this changes the intention of test.

  7. joyeecheung commented on Nov 15, 2021

    @joyeecheung
    Member

    It seems that the creation of file testsubdir/watch.txt changes the modification time of testsubdir - which seems correct to me.

    The commit that added this test was 515607a with the message

    fs: make fs.watch() non-recursive by default
    Fixes a behavioral regression introduced in commit 691b9eb.
    

    So I guess the intended behavior is that the changes shouldn't be notified in this case.

    I looked into the logs a bit more and it seems this first (as far as the reliability bot records) appeared in nodejs/reliability#68, none of the referenced PRs seem to be related, either. I'd say it's time to mark this as flaky already.

  8. lpinca commented on Nov 22, 2021

    @lpinca
    Member

    I've opened #40916 but I'm unable to reproduce the issue on my Windows machine.

    $ npx envinfo --system
    
      System:
        OS: Windows 10 10.0.19044
        CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
        Memory: 3.88 GB / 7.90 GB
    
  9. targos commented on Nov 22, 2021

    @targos
    MemberAuthor

    Windows 10 10.0.19044

    Is this the latest version of Windows 10?

  10. lpinca commented on Nov 22, 2021

    @lpinca
    Member

    Yes, updated a few minutes ago.

  11. Flarna commented on Nov 22, 2021

    @Flarna
    Member

    I tested again on a different (slower) Windows machine. Problem is not reproducible there but once I have VSCode running in background the test starts to fail (still executed without debugger from command line).

    Maybe VSCode does also some watching which causes such side effects.

    On the machine I tested first the test is flaky without VSCode running but fails stable if it runs in background.

  12. lpinca commented on Nov 22, 2021

    @lpinca
    Member

    I've VSCode and a virtual machine (Windows 10 on Hyper-V) running but I can't reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-testIssues and PRs involving tests that fail intermittently in CI.fsIssues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions