e2e: unflake testDockerExecStdin (#24385)

This commit is contained in:
Piotr Kazmierczak
2024-11-07 13:35:32 +01:00
committed by GitHub
parent c44f933aeb
commit 73383ee755

View File

@@ -7,6 +7,7 @@ import (
"archive/tar"
"bytes"
"context"
"fmt"
"strings"
"testing"
"time"
@@ -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)
@@ -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