From 884fba3838625626bc80c25ee091f5ebc343d171 Mon Sep 17 00:00:00 2001 From: Alex Aizman Date: Fri, 6 Sep 2024 13:52:14 -0400 Subject: [PATCH] test: fix running/finished race Signed-off-by: Alex Aizman --- ais/test/xaction_test.go | 18 +++++++++++++++--- cmd/cli/go.mod | 2 +- cmd/cli/go.sum | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ais/test/xaction_test.go b/ais/test/xaction_test.go index 2404838324..59aa179730 100644 --- a/ais/test/xaction_test.go +++ b/ais/test/xaction_test.go @@ -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 { diff --git a/cmd/cli/go.mod b/cmd/cli/go.mod index 14d9519919..4da5416a1e 100644 --- a/cmd/cli/go.mod +++ b/cmd/cli/go.mod @@ -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 diff --git a/cmd/cli/go.sum b/cmd/cli/go.sum index 16ead94d54..5b881ba263 100644 --- a/cmd/cli/go.sum +++ b/cmd/cli/go.sum @@ -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=