Skip to content

Conversation

@khendrikse
Copy link
Contributor

@khendrikse khendrikse commented Dec 4, 2025

🎉 Thanks for submitting a pull request! 🎉

Summary

  • Replace arbitrary pause() delays with event-based waitForLogMatching() in integration tests to reduce flakiness
  • Enhance waitForLogMatching() to check existing output buffer before listening for future events
  • Add configurable timeout parameter with clear error messages when events don't occur

Details
Problem: Tests used await pause(TIME) to wait for file watcher events. This is flaky because:

  • On slow machines, 500ms might not be enough
  • On fast machines, we wait longer than necessary
  • No feedback when something actually goes wrong

Solution: Replace blind delays with waitForLogMatching() which:

  • Resolves immediately when the expected log message appears
  • Uses the original timeout as a maximum wait time (safety net)
  • Throws a clear error if the event never happens

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

📊 Benchmark results

Comparing with beee144

  • Dependency count: 1,044 (no change)
  • Package size: 304 MB ⬆️ 0.00% increase vs. beee144
  • Number of ts-expect-error directives: 378 (no change)

@khendrikse khendrikse force-pushed the kh/try-to-improve-pause-behavior branch from 693c036 to 03e5860 Compare December 4, 2025 13:38
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