Skip to content

Commit

Permalink
e2e: unflake testDockerExecStdin (#24385)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak authored Nov 7, 2024
1 parent c44f933 commit 73383ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions e2e/allocexec/docker_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"archive/tar"
"bytes"
"context"
"fmt"
"strings"
"testing"
"time"
Expand All @@ -27,13 +28,14 @@ func TestDockerAllocExec(t *testing.T) {
}

func testDockerExecStdin(t *testing.T) {
_, cleanup := jobs3.Submit(t, "./input/sleepytar.hcl")
sub, cleanup := jobs3.Submit(t, "./input/sleepytar.hcl")
t.Cleanup(cleanup)

client, err := nomadapi.NewClient(nomadapi.DefaultConfig())
must.NoError(t, err)

allocations, _, err := client.Allocations().List(nil)
filter := fmt.Sprintf("JobID == \"%s\"", sub.JobID())
allocations, _, err := client.Allocations().List(&nomadapi.QueryOptions{Filter: filter})
must.NoError(t, err)
must.SliceLen(t, 1, allocations)

Expand Down Expand Up @@ -85,7 +87,7 @@ func testDockerExecStdin(t *testing.T) {
nil,
nil,
)
must.NoError(t, err)
must.NoError(t, err, must.Sprintf("error executing command inside the container: %v", err))
must.Zero(t, exitCode)

// check the output of tar
Expand Down

0 comments on commit 73383ee

Please sign in to comment.