test(integration): close the probe driver before the container scenario
The probe that detects a rootless daemon kept the host-wide runner lock, so the scenario's own driver failed with 'another ermite-runner is running'. Invisible while the test was only ever skipped (rootless daemon).
- commit
- 35b40b24164a1b6133033209173673d89086dad1
- author
- brice · · 2026-10-12 21:32 UTC
- parent
- ea0a5ee
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +6 -1
M internal/sandbox/integration/container_test.go +6 -1
| @@ -21,12 +21,17 @@ func TestContainerStubExecutor(t *testing.T) { | |||
| 21 | 21 | ctx := ctxWithLog(t) | |
| 22 | 22 | cfg := loadConfig(t, sandbox.Container) | |
| 23 | 23 | // A rootless daemon is refused with a clear error: nothing to test there. | |
| 24 | - | if _, err := drivers.Factories().Container(ctx, cfg); err != nil { | |
| 24 | + | probe, err := drivers.Factories().Container(ctx, cfg) | |
| 25 | + | if err != nil { | |
| 25 | 26 | if strings.Contains(err.Error(), "rootless") { | |
| 26 | 27 | t.Skipf("the Docker daemon is rootless, as designed the driver refuses it: %v", err) | |
| 27 | 28 | } | |
| 28 | 29 | t.Fatal(err) | |
| 29 | 30 | } | |
| 31 | + | // The probe holds the host-wide lock: release it before the scenario takes it. | |
| 32 | + | if err := probe.Close(); err != nil { | |
| 33 | + | t.Fatal(err) | |
| 34 | + | } | |
| 30 | 35 | scenario(t, ctx, cfg, sandbox.Container, func(t *testing.T, sb sandbox.Sandbox) { | |
| 31 | 36 | out, err := exec.Command("docker", "ps", "-q", "--filter", "label="+sandbox.LabelJob).Output() | |
| 32 | 37 | if err != nil { | |
| @@ -21,12 +21,17 @@ func TestContainerStubExecutor(t *testing.T) { | |||||
| 21 | ctx := ctxWithLog(t) | 21 | ctx := ctxWithLog(t) | ||
| 22 | cfg := loadConfig(t, sandbox.Container) | 22 | cfg := loadConfig(t, sandbox.Container) | ||
| 23 | // A rootless daemon is refused with a clear error: nothing to test there. | 23 | // A rootless daemon is refused with a clear error: nothing to test there. | ||
| 24 | - | if _, err := drivers.Factories().Container(ctx, cfg); err != nil { | 24 | + | probe, err := drivers.Factories().Container(ctx, cfg) |
| 25 | + | if err != nil { | |||
| 25 | if strings.Contains(err.Error(), "rootless") { | 26 | if strings.Contains(err.Error(), "rootless") { | ||
| 26 | t.Skipf("the Docker daemon is rootless, as designed the driver refuses it: %v", err) | 27 | t.Skipf("the Docker daemon is rootless, as designed the driver refuses it: %v", err) | ||
| 27 | } | 28 | } | ||
| 28 | t.Fatal(err) | 29 | t.Fatal(err) | ||
| 29 | } | 30 | } | ||
| 31 | + | // The probe holds the host-wide lock: release it before the scenario takes it. | |||
| 32 | + | if err := probe.Close(); err != nil { | |||
| 33 | + | t.Fatal(err) | |||
| 34 | + | } | |||
| 30 | scenario(t, ctx, cfg, sandbox.Container, func(t *testing.T, sb sandbox.Sandbox) { | 35 | scenario(t, ctx, cfg, sandbox.Container, func(t *testing.T, sb sandbox.Sandbox) { | ||
| 31 | out, err := exec.Command("docker", "ps", "-q", "--filter", "label="+sandbox.LabelJob).Output() | 36 | out, err := exec.Command("docker", "ps", "-q", "--filter", "label="+sandbox.LabelJob).Output() | ||
| 32 | if err != nil { | 37 | if err != nil { | ||