Repository navigation
[CRE-7129] Make sharding test deterministic by picking workflow names upfront - #24225
Open
dmitriytymosh wants to merge 1 commit into
Open
dmitriytymosh wants to merge 1 commit into
dmitriytymosh wants to merge 1 commit into
Conversation
Contributor
|
👋 dmitriytymosh, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Contributor
|
✅ No conflicts with other open PRs targeting |
dmitriytymosh
force-pushed
the
CRE-7129-deterministic-sharding-test
branch
from
November 19, 2026 22:17
5f13b2c to
cfc7e3f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CRE-7129
What
The sharding system tests required workflows on both shards, but shard placement is consistent hashing over the workflow ID, and the ID depends on the compiled WASM, so with fixed names all workflows occasionally landed on one shard (about 1 run in 15 with 5 workflows). The previous workaround raised the cron workflow count to 16, which only lowered the odds and slowed every run.
Now the test picks the workflow names upfront. It computes the workflow ID for each candidate name and the shard the ring routes it to, and keeps names until the workflows are split evenly between the two shards. The distribution no longer depends on hash luck, so the cron scenario is back to 5 workflows.
ring.LocateShard: exported wrapper over the existing ring placement, so tests use the same code as the nodes. No change in node behavior.workflow.ComputeWorkflowID: workflow ID derivation extracted fromRegisterWithContract, so prediction and registration share one implementation.t_helpers.WorkflowIDPredictor: compiles the workflow once and computes the ID per name.sharding_test.go:pickShardSpanningWorkflowNamesis used by the cron, EVM log and HTTP trigger scenarios.Requires
None.
Supports
None.
Deployment Validation Steps
Tests only, plus an exported helper in
core/services/ringthat nodes do not call. Nothing to validate in staging.Verified locally with Local CRE (
workflow-gateway-sharded-don.toml):Test_CRE_V2_Sharding(cron and EVM log) andTest_CRE_V2_ShardingWithHttpTriggerpass.golangci-lintv2.15.0 reports no issues for the changed packages.