Skip to content

Conversation

@B4nan
Copy link
Member

@B4nan B4nan commented Jan 6, 2026

This pull request refactors several test suites to improve reliability, resource management, and parallelization. The main focus is on updating browser plugin and crawler tests to use test.concurrent for parallel execution, ensuring proper cleanup of resources, and making asynchronous test timing more robust. It also updates some package dependencies.

Test Parallelization and Resource Management

  • Refactored all relevant tests in test/browser-pool/browser-plugins/plugins.test.ts and test/core/crawlers/browser_crawler.test.ts to use test.concurrent, enabling parallel test execution for faster and more reliable CI runs. Each test now instantiates plugins and resources locally, and ensures proper cleanup with finally blocks to close browsers and destroy emulators. [1] [2] [3] [4]
  • Removed shared variables and global resource setup/teardown in favor of per-test setup, preventing resource leaks and cross-test interference. [1] [2]

Improved Asynchronous Test Timing

  • Adjusted timing and request queue logic in test/core/crawlers/basic_crawler.test.ts to use buffered timeouts for adding requests and more robust completion checks, reducing flakiness in tests that depend on asynchronous queue operations. [1] [2]

Enhanced Test Assertions and Spying

  • Updated test logic to use spies and flags for verifying resource cleanup (e.g., browser pool destruction and session retirement), ensuring that critical teardown and error-handling paths are exercised and validated. [1] [2]

Dependency Updates

  • Upgraded vitest and @vitest/coverage-v8 dependencies in package.json for improved test performance and compatibility. [1] [2]

@github-actions github-actions bot added this to the 131st sprint - Tooling team milestone Jan 6, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Jan 6, 2026
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Jan 6, 2026
those were failing almost always locally on faster machines like mb m4 pro
@B4nan B4nan merged commit a2fa3ee into master Jan 6, 2026
10 checks passed
@B4nan B4nan deleted the fix-flaky-tests branch January 6, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants