Skip to content

Commit 1e94e6e

Browse files
authored
fix: Rework telemetry tests to use synctest (#1631)
Replace uses of a `sync.WaitGroup` to coordinate between different goroutines in tests with `testing/synctest`. That package, stable starting with Go 1.25, simplifies testing concurrent and asynchronous code by providing: - *Fake time*: Time advances automatically when goroutines block. - *Quiescence detection*: Deterministic synchronization instead of arbitrary delays. - *Fast, reliable tests*: Because of the fake time mechanism, test can wait for "arbitrary" periods of time and they will work. The clock will advance, but wallclock will be short. At the same time, you don't have to guess how much is enough. Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
1 parent fa48ab6 commit 1e94e6e

File tree

3 files changed

+205
-232
lines changed

3 files changed

+205
-232
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/grafana/synthetic-monitoring-agent
22

3-
go 1.24.0
3+
go 1.25.0
44

5-
toolchain go1.24.6
5+
toolchain go1.25.4
66

77
require (
88
github.com/go-kit/kit v0.13.0

0 commit comments

Comments
 (0)