fix: flaky test #11

Merged
argoyle merged 1 commits from fix-flaky-test into main 2022-09-30 20:58:33 +00:00
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -2,3 +2,7 @@ vendor
.gitignore
.git
Dockerfile
coverage.txt
coverage.html
/exported
/release
+7
View File
@@ -3,6 +3,7 @@ package kube
import (
"context"
"fmt"
"sort"
"testing"
"github.com/stretchr/testify/assert"
@@ -269,6 +270,12 @@ func TestClient_GetImages(t *testing.T) {
if !tt.wantErr(t, err, fmt.Sprintf("GetImages(%v, %v, %v)", ctx, logger, tt.args.namespaces)) {
return
}
for k, v := range got {
sort.SliceStable(v, func(i, j int) bool {
return v[i] < v[j]
})
got[k] = v
}
assert.Equalf(t, tt.want, got, "GetImages(%v, %v, %v)", ctx, logger, tt.args.namespaces)
logger.Check(t, tt.wantLogged)
})