Commit ee27909
committed
test: replace polling loops and injectable-time overrides with synctest
Replace assert.Eventually polling loops, time-variable overrides, and
runtime.Gosched() workarounds with deterministic synctest bubbles.
- ddtrace/tracer/abandonedspans_test: wrap all subtests in
synctest.Test, compute span start times relative to the fake clock's
time.Now(), and remove the setTestTime() helper that overrode the
package-level now var.
- internal/telemetry/client_test: wrap TestClientFlush in
synctest.Test; add a 1 ns sleep in the heartbeat case to advance the
fake clock past the rate-limiter interval; remove runtime.Gosched()
calls (no-op inside bubbles); switch from t.Cleanup to defer for
c.Close() so the ticker goroutine stops before the bubble exits.
- ddtrace/tracer/tracer_test: migrate TestTracerAtomicFlush and
TestWorker; replace a time.After+time.Sleep polling loop with
synctest.Wait() followed by a direct assertion.
Signed-off-by: Kemal Akkoyun <kemal.akkoyun@datadoghq.com>1 parent 0fad040 commit ee27909
File tree
4 files changed
+311
-303
lines changed- ddtrace/tracer
- internal
- log
- telemetry
4 files changed
+311
-303
lines changed
0 commit comments