mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
The TestHubTimeoutController_Sync test was failing intermittently in CI due to timing issues with time.Sleep() and real-time execution overhead. Changes: - Removed time.Sleep() dependency that caused flakiness - Set lease renew time in the past using time.Now().Add(-duration) to deterministically simulate aged leases - Made timeout threshold configurable per test case - Increased safety margin from 2s to 3s in "not timeout" case (2s lease age vs 5s timeout, previously 1s wait vs 3s timeout) - Set startTime in the past to bypass the 10s grace period check that was added to handle stale lease scenarios This eliminates race conditions in CI environments where execution overhead could push the test beyond the timeout threshold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: zhujian <jiazhu@redhat.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>