From 7fe31effefa29ebc72603a5e3133ebfa7fdeed35 Mon Sep 17 00:00:00 2001 From: Wessie Date: Tue, 14 May 2024 22:14:27 +0100 Subject: [PATCH] tracker: fix flaky test input --- tracker/parser_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tracker/parser_test.go b/tracker/parser_test.go index f86113be..1be57b86 100644 --- a/tracker/parser_test.go +++ b/tracker/parser_test.go @@ -19,6 +19,8 @@ import ( ) func genListener(a *arbitrary.Arbitraries) gopter.Gen { + timeRange := time.Nanosecond * (math.MaxInt64 / 2) + return gen.Struct(reflect.TypeFor[radio.Listener](), map[string]gopter.Gen{ "ID": a.GenForType(reflect.TypeFor[radio.ListenerClientID]()), "UserAgent": gen.AnyString().Map(func(in string) string { @@ -30,7 +32,7 @@ func genListener(a *arbitrary.Arbitraries) gopter.Gen { }, in)) }), "IP": gen.NumString(), - "Start": gen.TimeRange(time.Now(), time.Nanosecond*(math.MaxUint64/2)), + "Start": gen.TimeRange(time.Now().Add(-timeRange), timeRange), }) }