Skip to content

Conversation

cataggar
Copy link

@cataggar cataggar commented Oct 3, 2025

The job failed during the TestBuild/ARM64Linux/timers.go test. The log says: "fail: ticker should have stopped!" and "ticker was stopped (didn't send anything after 750ms)", indicating that the test expected the ticker to stop, but it did not behave as intended.

I was hitting this error in CI, so I asked Copilot to fix it and the fix looks good to me. At least the tests now pass.

@aykevl
Copy link
Member

aykevl commented Oct 4, 2025

This is a race condition. So it's not surprising it passes now, since the test passes most of the time.

Can you please explain why this is a correct fix (without using Copilot)?

@cataggar
Copy link
Author

cataggar commented Oct 4, 2025

@aykevl , unfortunately no. My Go skills aren't good enough to validate Copilot's reasoning:

// Set period to 0 to prevent the timer from being re-added to the queue
// if the callback is currently running. This must be done before removing
// the timer to avoid a race condition where the callback re-adds the timer
// after it's been removed.

If it does not make sense, please close. I just used some tokens trying to help out.

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.

3 participants