From 36e4b74de9f8ad71221825b019fd2e257270e2a0 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 1 May 2020 13:25:50 -0400 Subject: [PATCH] e2e: csi test can purge target job (#7823) --- e2e/csi/csi.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/e2e/csi/csi.go b/e2e/csi/csi.go index 4600d2b0d03..382d6a70559 100644 --- a/e2e/csi/csi.go +++ b/e2e/csi/csi.go @@ -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)