Skip to content

Conversation

@gepbird
Copy link
Contributor

@gepbird gepbird commented May 15, 2025

The onerror function got called multiple times, and we only stored the error of the last call.

When the test was passing, it was called with these err values:

  1. "ls:"
  2. "cannot access '/thisdirdefinitelydoesntexistimsureofitforreal': No such file or directory"

When the test was failing, it was called with these err values:

  1. "ls:"
  2. "cannot access '/thisdirdefinitelydoesntexistimsureofitforreal'"
  3. ": No such file or directory"
  4. "" (empty string, space or new line?)

The solution is to store all the errors, not only the last.

The `onerror` function got called multiple times, and we only stored the
error of the last call.

When the test was passing, it was called with these `err` values:
1. "ls:"
2. "cannot access '/thisdirdefinitelydoesntexistimsureofitforreal': No such file or directory"

When the test was failing, it was called with these `err` values:
1. "ls:"
2. "cannot access '/thisdirdefinitelydoesntexistimsureofitforreal'"
3. ": No such file or directory"
4. "" (empty string, space or new line?)

The solution is to store all the errors, not only the last.
@aaronik
Copy link
Owner

aaronik commented May 15, 2025

Awesome, thank you!

@aaronik aaronik merged commit 04d91c7 into aaronik:main May 15, 2025
1 check passed
@gepbird gepbird deleted the fix-flaky-test branch May 15, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants