Skip to content

Commit

Permalink
Fixes a flaky retention test. (#3833)
Browse files Browse the repository at this point in the history
This was due because the condition was using a string array that may be not in correct order.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
  • Loading branch information
cyriltovena authored Jun 10, 2021
1 parent 22c4b07 commit 7e658e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/sha256"
"encoding/base64"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -156,10 +157,13 @@ func Test_Retention(t *testing.T) {
expectDeleted = append(expectDeleted, tt.chunks[i].ExternalKey())
}
}
sort.Strings(expectDeleted)
store.Stop()
if len(expectDeleted) != 0 {
require.Eventually(t, func() bool {
return assert.ObjectsAreEqual(expectDeleted, chunkClient.getDeletedChunkIds())
actual := chunkClient.getDeletedChunkIds()
sort.Strings(actual)
return assert.ObjectsAreEqual(expectDeleted, actual)
}, 10*time.Second, 1*time.Second)
}
})
Expand Down

0 comments on commit 7e658e8

Please sign in to comment.