mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user