mirror of
https://github.com/kopia/kopia.git
synced 2026-10-22 22:24:49 -04:00
test(server): fixed flaky TestSnapshotCounters test (#1734)
This commit is contained in:
1 parent
4fb473dc77
commit
04f70f74f3
1 file changed
+8
-2
@@ -68,11 +68,17 @@ func TestSnapshotCounters(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// wait until new task for the upload is created
|
||||
deadline := clock.Now().Add(10 * time.Second)
|
||||
for mustGetLatestTask(t, cli).TaskID == et.TaskID && clock.Now().Before(deadline) {
|
||||
deadline := clock.Now().Add(30 * time.Second)
|
||||
|
||||
latest := mustGetLatestTask(t, cli)
|
||||
for latest.TaskID == et.TaskID && clock.Now().Before(deadline) {
|
||||
time.Sleep(100 * time.Microsecond)
|
||||
|
||||
latest = mustGetLatestTask(t, cli)
|
||||
}
|
||||
|
||||
require.NotEqual(t, latest.TaskID, et.TaskID)
|
||||
|
||||
ut := waitForTask(t, cli, mustGetLatestTask(t, cli).TaskID, 15*time.Second)
|
||||
|
||||
t.Logf("got latest task: %v", ut)
|
||||
|
||||
Reference in new issue
Block a user