test(e2e): enable parallel execution for multiple tests#79
test(e2e): enable parallel execution for multiple tests#79ZiyangLinScality merged 2 commits intomainfrom
Conversation
- Added `t.Parallel()` to various end-to-end tests to allow concurrent execution, improving test efficiency and reducing overall runtime. - Updated tests across multiple files, including cascade GC, multi-namespace, namespace deletion, pod lifecycle, and real HTTP tests.
There was a problem hiding this comment.
Pull request overview
This PR adds t.Parallel() to multiple end-to-end tests to enable concurrent execution, aiming to improve test efficiency and reduce overall runtime.
Changes:
- Added
t.Parallel()to 13 test functions across 6 test files - Tests span cascade GC, multi-namespace operations, namespace deletion, pod lifecycle, HTTP behavior, and basic operator functionality
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/real_http_test.go | Added parallel execution to 4 HTTP-related tests that verify reconcile storm prevention, timeout handling, recovery after failure, and fetch triggering |
| test/e2e/pod_lifecycle_test.go | Added parallel execution to 3 pod lifecycle tests including rolling updates and operator crash recovery tests |
| test/e2e/namespace_deletion_test.go | Added parallel execution to namespace deletion cascade cleanup test |
| test/e2e/multi_namespace_test.go | Added parallel execution to 2 multi-namespace tests for component aggregation and partial deletion |
| test/e2e/e2e_test.go | Added parallel execution to 3 core tests covering CRD installation, operator deployment, and full chain smoke test |
| test/e2e/cascade_gc_test.go | Added parallel execution to 2 cascade garbage collection tests for exposer updates and deletion cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| func TestPodLifecycle_OperatorCrashRecovery(t *testing.T) { | ||
| t.Parallel() |
There was a problem hiding this comment.
This test deletes the operator pod as part of its execution (see line 294), which affects the entire cluster. Running this test in parallel with TestPodLifecycle_NoSpuriousUpdatesAfterRestart (which also deletes the operator pod at line 469) can cause race conditions and test flakiness. These two tests should not run in parallel because they both manipulate the shared operator deployment. Consider either removing t.Parallel from both these disruptive tests, or implementing a synchronization mechanism (such as a mutex or test label filtering) to ensure they run sequentially.
| t.Parallel() |
| } | ||
|
|
||
| func TestPodLifecycle_NoSpuriousUpdatesAfterRestart(t *testing.T) { | ||
| t.Parallel() |
There was a problem hiding this comment.
This test deletes the operator pod as part of its execution (see line 469), which affects the entire cluster. Running this test in parallel with TestPodLifecycle_OperatorCrashRecovery (which also deletes the operator pod at line 294) can cause race conditions and test flakiness. These two tests should not run in parallel because they both manipulate the shared operator deployment. Consider either removing t.Parallel from both these disruptive tests, or implementing a synchronization mechanism (such as a mutex or test label filtering) to ensure they run sequentially.
- Removed `t.Parallel()` from multiple real HTTP end-to-end tests to ensure sequential execution, addressing potential issues with shared state and resource contention during tests. - This change aims to improve test reliability and maintainability.
t.Parallel()to various end-to-end tests to allow concurrent execution, improving test efficiency and reducing overall runtime.