mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-12 04:17:16 +02:00
fix(test): stop the Windows test job from failing at random (#6182)
* fix(persistence): don't format a nil-model row in wrapCursor * test(plugins): assert task queue delay against the first dispatch, not consecutive gaps * test(artwork): let the e2e worker wait outlast one retry * chore: trim comments * fix(persistence): guard dbFolder and dbMediaFile String() against a nil model
This commit is contained in:
parent
8b4125267e
commit
0429fb3d40
7 changed files with 39 additions and 6 deletions
|
|
@ -689,11 +689,12 @@ var _ = Describe("TaskQueueService", func() {
|
|||
copy(times, dispatchTimes)
|
||||
mu.Unlock()
|
||||
|
||||
// Consecutive dispatches should have at least ~160ms gap (80% of 200ms)
|
||||
// Wake-up latency varies per worker, so check offsets from the first dispatch, not gaps.
|
||||
for i := 1; i < len(times); i++ {
|
||||
gap := times[i].Sub(times[i-1])
|
||||
Expect(gap).To(BeNumerically(">=", 160*time.Millisecond),
|
||||
fmt.Sprintf("gap between dispatch %d and %d was %v, expected >= 160ms", i-1, i, gap))
|
||||
offset := times[i].Sub(times[0])
|
||||
minOffset := time.Duration(i)*200*time.Millisecond - 50*time.Millisecond
|
||||
Expect(offset).To(BeNumerically(">=", minOffset),
|
||||
fmt.Sprintf("dispatch %d ran %v after the first, expected >= %v", i, offset, minOffset))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue