Skip to content

Commit

Permalink
fix #12439 backport
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Apr 20, 2022
1 parent be0bd02 commit 05d53aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nomad/core_sched_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2375,11 +2375,11 @@ func TestCoreScheduler_CSIVolumeClaimGC(t *testing.T) {

err = msgpackrpc.CallWithCodec(codec, "CSIVolume.Claim",
req, &structs.CSIVolumeClaimResponse{})
require.NoError(t, err, "unpublishing claim should succeed")
require.NoError(err, "unpublishing claim should succeed")

require.Eventually(t, func() bool {
vol, err := store.CSIVolumeByID(ws, ns, volID)
require.NoError(t, err)
require.Eventually(func() bool {
vol, err := state.CSIVolumeByID(ws, ns, volID)
require.NoError(err)
return len(vol.WriteClaims) == 1 &&
len(vol.WriteAllocs) == 1 &&
len(vol.PastClaims) == 0
Expand All @@ -2389,7 +2389,7 @@ func TestCoreScheduler_CSIVolumeClaimGC(t *testing.T) {
// At this point we can guarantee that volumewatcher is waiting
// for new work. Delete allocation and job so that the next pass
// thru volumewatcher has more work to do
index, _ = store.LatestIndex()
index, _ = state.LatestIndex()
index++
err = state.DeleteJob(index, ns, job.ID)
require.NoError(err)
Expand All @@ -2399,7 +2399,7 @@ func TestCoreScheduler_CSIVolumeClaimGC(t *testing.T) {
require.NoError(err)

// Create a core scheduler and attempt the volume claim GC
snap, err := store.Snapshot()
snap, err := state.Snapshot()
require.NoError(err)

core := NewCoreScheduler(srv, snap)
Expand Down

0 comments on commit 05d53aa

Please sign in to comment.