E2E/CSI: ensure jobs are stopped before checking claims are released

During refactoring of the CSI jobs, the EBS test dropped stopping the jobs
before checking that the claims were released.
This commit is contained in:
Tim Gross
2021-04-15 09:19:07 -04:00
committed by Tim Gross
parent 257dba5110
commit 24a4953c00

View File

@@ -75,6 +75,14 @@ func (tc *CSIControllerPluginEBSTest) BeforeAll(f *framework.F) {
// AfterAll cleans up the volumes and plugin jobs created by the test.
func (tc *CSIControllerPluginEBSTest) AfterAll(f *framework.F) {
// Stop all jobs in test
for _, id := range tc.testJobIDs {
out, err := e2e.Command("nomad", "job", "stop", "-purge", id)
f.Assert().NoError(err, out)
}
tc.testJobIDs = []string{}
for _, volID := range tc.volumeIDs {
err := waitForVolumeClaimRelease(volID, reapWait)
f.Assert().NoError(err, "volume claims were not released")