unify the default timeout#483
Conversation
WalkthroughThe PR centralizes Eventually timing by setting global defaults in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/pkg/resources_test.go (1)
307-318:⚠️ Potential issue | 🟡 MinorAdd explicit duration to strengthen the "not updated" verification.
The test suite sets defaults for
Eventually(2 minutes) but does not configureConsistentlydefaults. Without an explicit duration,Consistentlyuses Gomega's brief built-in default, which weakens the guarantee that the nested work was not updated over a meaningful observation window. Specify a duration to ensure sufficient observation time.Proposed adjustment (example duration)
- Consistently(func() error { + Consistently(func() error { nestedWork, err := agentTestOpts.workClientSet.WorkV1().ManifestWorks(nestedWorkNamespace).Get(ctx, nestedWorkName, metav1.GetOptions{}) if err != nil { return err } @@ - return nil - }).Should(BeNil()) + return nil + }, 10*time.Second, 1*time.Second).Should(BeNil())
🤖 Fix all issues with AI agents
In `@test/e2e/pkg/sourceclient_test.go`:
- Around line 206-211: The Consistently call used to assert
otherConsumerWatcherResult.WatchedWorks stays empty needs an explicit longer
duration; update the Consistently invocation in the test (the call that checks
otherConsumerWatcherResult.WatchedWorks) to include a meaningful timeout (e.g.,
5*time.Second) as a second argument and ensure the time package is imported if
missing so the assertion runs over the intended window rather than the 100ms
default.
In `@test/e2e/pkg/suite_test.go`:
- Around line 199-201: The AfterSuite cleanup uses Eventually without an
explicit timeout which can flake on slow clusters; update the call that invokes
cleanupResources via Eventually to set a longer explicit timeout (e.g., call
Eventually(...).WithTimeout(5 * time.Minute).ShouldNot(HaveOccurred())) so the
cleanupResources(ctx) invocation has enough time to list/delete ManifestWorks
and AppliedManifestWorks; modify the Eventually invocation wrapping
cleanupResources to include WithTimeout and import time if not already present.
Signed-off-by: Wei Liu <liuweixa@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/pkg/resources_test.go (1)
307-318:⚠️ Potential issue | 🟠 MajorAdd explicit duration to
Consistentlyblock to meaningfully verify nested work remains unchanged.The
SetDefaultEventuallyTimeoutset insuite_test.goaffects onlyEventually, notConsistently. The defaultConsistentlyduration is 100ms, which allows only ~10 polling checks before completing. This is insufficient to meaningfully assert that the nested work generation remains stable.Add explicit durations to ensure the assertion runs long enough to catch any spurious updates:
Proposed fix
Consistently(func() error { nestedWork, err := agentTestOpts.workClientSet.WorkV1().ManifestWorks(nestedWorkNamespace).Get(ctx, nestedWorkName, metav1.GetOptions{}) if err != nil { return err } if nestedWork.Generation != 1 { return fmt.Errorf("nested work generation is changed to %d", nestedWork.Generation) } return nil - }).Should(BeNil()) + }, 30*time.Second, 1*time.Second).Should(BeNil())
|
/cc @clyang82 |
No description provided.