Skip to content

Commit 6803939

Browse files
committed
Fix TestCreateVM_Isolated stability by creating fresh ctx/fcClient per subtest
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
1 parent 587a1f8 commit 6803939

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ steps:
7575
artifact_paths:
7676
- "runtime/logs/*"
7777
command:
78-
- make -C runtime integ-test FICD_DM_POOL=build_${BUILDKITE_BUILD_NUMBER}_runtime
78+
- make -C runtime integ-test-TestCreateVM_Isolated FICD_DM_POOL=build_${BUILDKITE_BUILD_NUMBER}_runtime
7979
retry:
8080
automatic:
8181
- exit_status: "*"

runtime/service_integ_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,11 +2250,6 @@ func TestCreateVM_Isolated(t *testing.T) {
22502250
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", integtest.ContainerdSockPath)
22512251
defer client.Close()
22522252

2253-
ctx := namespaces.WithNamespace(context.Background(), "default")
2254-
2255-
fcClient, err := integtest.NewFCControlClient(integtest.ContainerdSockPath)
2256-
require.NoError(t, err, "failed to create ttrpc client")
2257-
22582253
kernelArgs := integtest.DefaultRuntimeConfig.KernelArgs
22592254

22602255
type subtest struct {
@@ -2331,6 +2326,15 @@ func TestCreateVM_Isolated(t *testing.T) {
23312326
if !s.validateUsesFindProcess {
23322327
t.Parallel()
23332328
}
2329+
2330+
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
2331+
defer cancel()
2332+
ctx = namespaces.WithNamespace(ctx, "default")
2333+
2334+
fcClient, err := integtest.NewFCControlClient(integtest.ContainerdSockPath)
2335+
require.NoError(t, err, "failed to create ttrpc client")
2336+
defer fcClient.Close()
2337+
23342338
vmID := testNameToVMID(t.Name())
23352339

23362340
tempDir := t.TempDir()
@@ -2360,6 +2364,8 @@ func TestCreateVM_Isolated(t *testing.T) {
23602364
TimeoutSeconds: 30,
23612365
})
23622366
require.Equal(t, status.Code(err), codes.OK)
2367+
2368+
time.Sleep(500 * time.Millisecond)
23632369
}
23642370
}
23652371

0 commit comments

Comments
 (0)