Skip to content

Commit

Permalink
test: fix running/finished race
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Sep 6, 2024
1 parent 7139207 commit 884fba3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions ais/test/xaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,22 @@ func TestXactionAllStatus(t *testing.T) {
if ns.AbortedX {
tlog.Logf("%q is aborted but hasn't finished yet\n", ns.String())
aborted = append(aborted, ns)
} else {
// doesn't appear to be aborted and is, therefore, expected to be running
tassert.Errorf(t, ns.EndTimeX == 0, "%q: non-sero fin time=%v",
} else if ns.EndTimeX != 0 {
tlog.Logf("Warning: must've %q already finished (non-zero fin time=%v)\n",
ns.String(), time.Unix(0, ns.EndTimeX))

// un-race
xargs.OnlyRunning = true
vec2, err2 := api.GetAllXactionStatus(baseParams, &xargs)
tassert.CheckFatal(t, err2)
for _, ns2 := range vec2 {
if ns2.UUID == ns.UUID {
tassert.Errorf(t, ns.EndTimeX == 0, "%q (1) already finished (non-zero fin time=%v)",
ns.String(), time.Unix(0, ns.EndTimeX))
tassert.Errorf(t, ns2.EndTimeX == 0, "%q (2) already finished (non-zero fin time=%v)",
ns2.String(), time.Unix(0, ns2.EndTimeX))
}
}
}
}
if len(aborted) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/cli
go 1.22.3

require (
github.com/NVIDIA/aistore v1.3.24-0.20240906164715-2998ad1bbf9f
github.com/NVIDIA/aistore v1.3.24-0.20240906170600-713920710479
github.com/fatih/color v1.17.0
github.com/json-iterator/go v1.1.12
github.com/onsi/ginkgo/v2 v2.20.0
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/NVIDIA/aistore v1.3.24-0.20240906164715-2998ad1bbf9f h1:Prd6cKrvxO/QaU4q+c2LWhk6bSUAoLZ4aAXQoIdv8L8=
github.com/NVIDIA/aistore v1.3.24-0.20240906164715-2998ad1bbf9f/go.mod h1:si83S9r29vwIC0f0CE2Mk+25bFiaN6mmVlmuBpP4hHM=
github.com/NVIDIA/aistore v1.3.24-0.20240906170600-713920710479 h1:JUPW/hrRVa9zqxjJNBXrWdscGyVBv1dhsT9nNPi4V+8=
github.com/NVIDIA/aistore v1.3.24-0.20240906170600-713920710479/go.mod h1:si83S9r29vwIC0f0CE2Mk+25bFiaN6mmVlmuBpP4hHM=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
Expand Down

0 comments on commit 884fba3

Please sign in to comment.