status-go
status-go copied to clipboard
Remove use of time.Sleep in telemetry tests
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