Skip to content

feat(sharding): respect --fully-parallel when sharding - #64

Merged
aslushnikov merged 3 commits into
mainfrom
better-sharding
Jun 24, 2026
Merged

aslushnikov merged 3 commits into
mainfrom
better-sharding

Conversation

@aslushnikov

Copy link
Copy Markdown
Contributor

This patch updates sharding behavior so that it follows Playwright's
sharding behavior more closely.

Specifically:

  • by default, we use files as a sharding unit
  • to use per-test sharding, the fullyParallel mode should be enabled
    either per project or per test suite

With these changes, the flakiness-playwright-shard binary should be an
easy drop-in replacement for the native Playwright sharding.

This patch updates sharding behavior so that it follows Playwright's
sharding behavior more closely.

Specifically:
- by default, we use files as a sharding unit
- to use per-test sharding, the `fullyParallel` mode should be enabled
  either per project or per test suite

With these changes, the `flakiness-playwright-shard` binary should be an
easy drop-in replacement for the native Playwright sharding.
@aslushnikov

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f69e88682

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sharding.ts Outdated

const testEntryId = createTestEntryId(testCase, config.rootDir);
const shardGroupId = outermostSerialSuite(testCase) ?? testEntryId;
const shardGroupId = computeShardSuite(testCase)?.titlePath().join(' › ') ?? testEntryId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve suite identity in shard keys

When fullyParallel is enabled and a file contains two distinct sequential suites with the same title path, such as two test.describe.serial('checkout', ...) blocks, this string key collapses them into one ShardGroup. The previous Suite object key kept those suites independent, so unrelated serial/default groups can no longer be balanced across shards and two equally heavy duplicate suites would all land on the same shard. Keep the Suite object as the key for suite-based groups and only use the test id for per-test groups.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ef2ba784d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sharding.ts Resolved
@aslushnikov
aslushnikov merged commit 2d6d9d7 into main Jun 24, 2026
7 checks passed
@aslushnikov
aslushnikov deleted the better-sharding branch June 24, 2026 23:18
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.

1 participant