这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Lazar955
Copy link
Member

Cosmos e2e tests take way too long to run sequentially, now makes them parallel

closes #599

Copilot AI review requested due to automatic review settings August 11, 2025 09:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables parallel execution of Cosmos e2e tests to reduce the overall test execution time. The changes address race conditions caused by global address prefix configuration in the Cosmos SDK and implement dynamic port allocation to prevent conflicts between parallel test instances.

  • Introduces thread-safe address prefix management using a mutex
  • Replaces hardcoded ports with dynamic port allocation
  • Adds t.Parallel() calls to enable parallel test execution

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
bsn/cosmos/e2e/bcd_test_manager.go Adds mutex for thread-safe address prefix configuration and helper functions
bsn/cosmos/e2e/bcd_handler.go Implements dynamic port allocation for RPC, P2P, and gRPC connections
bsn/cosmos/e2e/bcd_consumer_e2e_test.go Enables parallel test execution and uses thread-safe prefix functions

"encoding/base64"
"encoding/json"
"fmt"
bbnappparams "github.com/babylonlabs-io/babylon-sdk/demo/app/params"
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The import for bbnappparams is moved to the top but is only used in one function (setBbncAppPrefixesSafely). Consider moving this import closer to where it's used or adding a comment explaining why it needs to be at the top level.

Copilot uses AI. Check for mistakes.
w.contractAddress = contractAddr
}

w.relayerAPIPort = testutil.AllocateUniquePort(t)
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The relayerAPIPort is allocated in StartRelayer but the other ports (rpcPort, p2pPort, grpcPort) are allocated in NewBcdNodeHandler. For consistency, consider allocating all ports in the same location or adding a comment explaining why this one is different.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +45
t.Parallel()
setBbnAddressPrefixesSafely()
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@Lazar955 Lazar955 merged commit b3beec8 into main Aug 11, 2025
18 checks passed
@Lazar955 Lazar955 deleted the lazar/run-cosmos-e2e-parallel branch August 11, 2025 10:16
Lazar955 added a commit that referenced this pull request Aug 12, 2025
Cosmos e2e tests take way too long to run sequentially, now makes them
parallel

closes #599
Lazar955 added a commit that referenced this pull request Aug 12, 2025
Cosmos e2e tests take way too long to run sequentially, now makes them
parallel

closes #599
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.

[Cosmos] Parallel e2e

3 participants