Skip to content

src/io/watchFile.test.ts flaky test on refactor branch. #2140

Description

@Hweinstock
src/io/watchFile.test.ts:
  24 |   watchFile(path, () => calls++, controller.signal);
  25 | 
  26 |   writeFileSync(path, '{"a":1}');
  27 |   writeFileSync(path, '{"a":2}');
  28 |   await Bun.sleep(250);
  29 |   expect(calls).toBe(1);
                       ^
  error: expect(received).toBe(expected)
  
  Expected: 1
  Received: 0
  
        at <anonymous> (/Users/runner/work/agentcore-cli/agentcore-cli/src/io/watchFile.test.ts:29:17)
  
  Error: Expected: 1
  Received: 0
  
        at <anonymous> (/Users/runner/work/agentcore-cli/agentcore-cli/src/io/watchFile.test.ts:29:17)
  (fail) debounces a burst of edits into a single callback and stops on abort [257.78ms]
  (pass) a missing file fails quietly rather than throwing [0.18ms]

Ex. https://github.com/aws/agentcore-cli/actions/runs/33117797255/job/98676836925

Seen it fail twice on MacOS, retrying fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions