status-go icon indicating copy to clipboard operation
status-go copied to clipboard

Remove use of time.Sleep in telemetry tests

Open adklempner opened this issue 1 year ago • 0 comments

Problem

Tests need to be deterministic. Currently, tests of the telemetry client rely on use of time.Sleep to trigger the behavior.

Implementation

Replace use of time.Sleep with direct invocation of functionality being tested (e.g. https://github.com/status-im/status-go/pull/5885 )

Acceptance Criteria

No instances of time.Sleep in telemetry/client_test.go

Notes

Likely means using client.Start() in tests is a no-go. May be worth refactoring some of the logic within the go-routines that it starts into functions.

Future Steps

Avoid time.Sleep in new tests moving forward

adklempner avatar Sep 28 '24 02:09 adklempner