Merge pull request #1379 from trheyi/main

Improve test reliability in TestSubscribeFrom by adjusting sleep dura…
This commit is contained in:
Max 2025-12-11 18:09:07 +08:00 committed by GitHub
commit 16676f2e8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,13 +121,17 @@ func TestSubscribeFrom(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
// Wait to ensure different timestamp (simulate time passing) // Wait to ensure different timestamp (simulate time passing)
// Use a longer sleep to account for CI environment variability
time.Sleep(1100 * time.Millisecond) time.Sleep(1100 * time.Millisecond)
// Record timestamp (simulate user noting current time before refresh) // Record timestamp (simulate user noting current time before refresh)
resumeTimestamp := time.Now().UnixMilli() // Subtract 1ms to ensure we capture events that happen "now"
// This accounts for millisecond precision and timing variability in CI
resumeTimestamp := time.Now().UnixMilli() - 1
// Wait again to ensure next operations are after resumeTimestamp // Wait to ensure next operations have a clearly different timestamp
time.Sleep(100 * time.Millisecond) // Use longer sleep for CI reliability
time.Sleep(500 * time.Millisecond)
// Continue with more operations // Continue with more operations
_, err = manager.Add("Step 2", types.TraceNodeOption{Label: "Finalizing"}) _, err = manager.Add("Step 2", types.TraceNodeOption{Label: "Finalizing"})