Skip to content

ci: add support for parallel runs#4094

Merged
wellwelwel merged 47 commits intosidorares:masterfrom
wellwelwel:parallel
Feb 19, 2026
Merged

ci: add support for parallel runs#4094
wellwelwel merged 47 commits intosidorares:masterfrom
wellwelwel:parallel

Conversation

@wellwelwel
Copy link
Collaborator

@wellwelwel wellwelwel commented Feb 19, 2026

Fixes #3859.

This isn't just about adding support for parallel testing. When running all tests simultaneously, many tests proved to be fragile and dependent on external tests being run beforehand (by other files).

By forcing a random execution order (even if still sequentially), several tests began to fail due to tests that affect MySQL Server global variables/states. These tests have been isolated in ./test/esm/global/ (temporary path until the .cjs files are completely removed).

  • Now they perform the necessary global changes in isolation and restore them to their original state at the end of testing, ensuring that no compromised tests can compromise or cause false positives in unrelated tests.

Now the tests run in parallel and, naturally, tend to finish faster since they are launched simultaneously.

Together, I fixed an incorrect structure in the creation and closing of connections, mentioned in #3859. Basically, the challenge was to ensure that no connection is created or closed in the same scope that may contain intentional failures (e.g., assertions) in the tests, for example:

❌ Current approach

import { describe, it, assert } from 'poku';

await describe('test', async () => {
  it('should do something', () => {
    const connection = await createConnection();

    assert(false); // will fail here

    await connection.end(); // the connection will never be reached
  });

  // the process will remain hanging indefinitely
});

✨ New approach

import { describe, it, assert } from 'poku';

await describe('test', async () => {
  const connection = await createConnection();

  it('should do something', () => {
    assert(false); // will fail in its own scope
  });

  await connection.end();
});
  • The same idea applies to callbacks, but with more complex approaches adapted to each test.

Special thanks to @HappyZombies, who identified the issue and now it will be possible to enable all tests for Bun (not for this PR) 🎉

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.95%. Comparing base (250ea8f) to head (759a652).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4094   +/-   ##
=======================================
  Coverage   89.95%   89.95%           
=======================================
  Files          86       86           
  Lines       13663    13663           
  Branches     1636     1634    -2     
=======================================
  Hits        12291    12291           
  Misses       1372     1372           
Flag Coverage Δ
compression-0 89.07% <ø> (ø)
compression-1 89.93% <ø> (ø)
static-parser-0 87.54% <ø> (ø)
static-parser-1 88.30% <ø> (ø)
tls-0 89.36% <ø> (ø)
tls-1 89.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wellwelwel wellwelwel marked this pull request as ready for review February 19, 2026 10:13
@wellwelwel wellwelwel merged commit dc804f7 into sidorares:master Feb 19, 2026
100 checks passed
@wellwelwel wellwelwel deleted the parallel branch February 19, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests can hang indefinitely when connection resources aren’t cleaned up after assertion failures

1 participant