Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 6, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

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]](diffhunk://#diff-5dfcab8448ae6fd50e61cc86cbec51b16b264bad9720ef1e8b9790847ab31a7eL47-R60)
[[2]](diffhunk://#diff-5dfcab8448ae6fd50e61cc86cbec51b16b264bad9720ef1e8b9790847ab31a7eL195-R200)
[[3]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afL46-R55)
[[4]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afR99-R109)
* Removed shared variables and global resource setup/teardown in favor
of per-test setup, preventing resource leaks and cross-test
interference.
[[1]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afL29-L30)
[[2]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afL46-R55)

**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]](diffhunk://#diff-c4185470dff91dc8b058f47425670075e27d8e84c31cfefcc4f10919bd45728dL959-R980)
[[2]](diffhunk://#diff-c4185470dff91dc8b058f47425670075e27d8e84c31cfefcc4f10919bd45728dL1019-R1031)

**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]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afL121-R159)
[[2]](diffhunk://#diff-18569d608db098f33b40875170c9fbd8024d929569ad756a4d8139569b80d6afL152-R184)

**Dependency Updates**

* Upgraded `vitest` and `@vitest/coverage-v8` dependencies in
`package.json` for improved test performance and compatibility.
[[1]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L85-R85)
[[2]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L116-R116)
@pull pull bot locked and limited conversation to collaborators Jan 6, 2026
@pull pull bot added the ⤵️ pull label Jan 6, 2026
@pull pull bot merged commit a2fa3ee into threatcode:master Jan 6, 2026
@pull pull bot had a problem deploying to github-pages January 6, 2026 16:19 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant