Skip to content

Commit

Permalink
e2e: csi test can purge target job (#7823)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross authored May 1, 2020
1 parent f5775de commit 36e4b74
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions e2e/csi/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,11 @@ func (tc *CSIVolumesTest) TestEBSVolumeClaim(f *framework.F) {
_, err = readFile(nomadClient, writeAlloc, expectedPath)
require.NoError(err)

// Shutdown the writer so we can run a reader.
// Shutdown (and purge) the writer so we can run a reader.
// we could mount the EBS volume with multi-attach, but we
// want this test to exercise the unpublish workflow.
//
// TODO(tgross): we should pass true here to run the equivalent
// of 'nomad job stop -purge' but this makes the test really
// racy. Once the unmount hang problem with -purge is fixed,
// we can restore this.
nomadClient.Jobs().Deregister(writeJobID, false, nil)
// this runs the equivalent of 'nomad job stop -purge'
nomadClient.Jobs().Deregister(writeJobID, true, nil)
// instead of waiting for the alloc to stop, wait for the volume claim gc run
require.Eventuallyf(func() bool {
vol, _, err := nomadClient.CSIVolumes().Info(volID, nil)
Expand Down

0 comments on commit 36e4b74

Please sign in to comment.