From 340c9ebd4755c0ab2325aa92c243b344d7956db3 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Wed, 6 Dec 2023 16:34:54 -0500 Subject: [PATCH] E2E: extend timeout on CSI snapshot test (#19338) The EBS snapshot operation can take a long time to complete. Recent runs have shown we sometimes get up to the 10s timeout on the context we're giving the CLI command. Extend this so that we're not getting spurious timeouts. Fixes: https://github.com/hashicorp/nomad/issues/19118 --- e2e/csi/ebs.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/e2e/csi/ebs.go b/e2e/csi/ebs.go index 0e044527b..be998d9fc 100644 --- a/e2e/csi/ebs.go +++ b/e2e/csi/ebs.go @@ -4,7 +4,9 @@ package csi import ( + "context" "fmt" + "os/exec" "time" "github.com/hashicorp/nomad/e2e/e2eutil" @@ -195,8 +197,12 @@ func (tc *CSIControllerPluginEBSTest) TestVolumeClaim(f *framework.F) { // TestSnapshot exercises the snapshot commands. func (tc *CSIControllerPluginEBSTest) TestSnapshot(f *framework.F) { - out, err := e2eutil.Command("nomad", "volume", "snapshot", "create", - tc.volumeIDs[0], "snap-"+tc.uuid) + // EBS snapshots can take a very long time to run + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + bytes, err := exec.CommandContext(ctx, "nomad", "volume", "snapshot", "create", + tc.volumeIDs[0], "snap-"+tc.uuid).CombinedOutput() + out := string(bytes) requireNoErrorElseDump(f, err, "could not create volume snapshot", tc.pluginJobIDs) snaps, err := e2eutil.ParseColumns(out)