Skip to content

Commit

Permalink
tracker: fix flaky test input
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed May 14, 2024
1 parent 9dc6eaa commit 7fe31ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tracker/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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),
})
}

Expand Down

0 comments on commit 7fe31ef

Please sign in to comment.