diff options
| author | James O'Doherty <james@theodohertyfamily.com> | 2026-05-29 21:24:42 -0400 |
|---|---|---|
| committer | James O'Doherty <james@theodohertyfamily.com> | 2026-05-29 21:24:42 -0400 |
| commit | b098e2845b68ce90f34e4e1e927b4914d0b00ef7 (patch) | |
| tree | 2288efa8e09ab93735e6ae2c25d42ee33634eb2a /tests/e2e/lifecycle_test.go | |
| parent | 0f3806f77164af99466bfc8c0d7d5f85f9ec078f (diff) | |
fix: resolve deadlocks, routing errors, and test timings in test suite
- fix(cli): resolve Flock self-deadlock in ExecuteCommand cleanup by reusing the existing lockFile handle if already held during premature exit.
- fix(wireguard): configure explicit default route destination (0.0.0.0/0 for IPv4 and ::/0 for IPv6) to avoid netlink "either Dst.IP, Src.IP or Gw must be set" error.
- fix(wireguard): initialize the Tunnel return parameter in StartTunnel to prevent a nil pointer dereference.
- test(e2e): fix argument ordering in waitForLifecycle to pass "test-lifecycle" first, and increase sleep duration of dummy processes to 1.0s to ensure reliable process persistence under race detection.
Diffstat (limited to 'tests/e2e/lifecycle_test.go')
| -rw-r--r-- | tests/e2e/lifecycle_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/e2e/lifecycle_test.go b/tests/e2e/lifecycle_test.go index 4b452da..67b1370 100644 --- a/tests/e2e/lifecycle_test.go +++ b/tests/e2e/lifecycle_test.go @@ -47,7 +47,7 @@ func waitForLifecycle(t *testing.T, binaryPath, runtimeDir, profile string, expe case <-timeout: t.Fatalf("Timed out waiting for lifecycle state: expected active=%v", expectedActive) case <-tick.C: - cmd := exec.Command(binaryPath, "--profile", profile, "test-lifecycle") + cmd := exec.Command(binaryPath, "test-lifecycle", "--profile", profile) cmd.Env = append(os.Environ(), fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir)) err := cmd.Run() @@ -78,7 +78,7 @@ func TestNamespaceLifecycleAutomation(t *testing.T) { t.Run("ReferenceCounting", func(t *testing.T) { // Start a process that exits quickly - cmd1 := exec.Command(binaryPath, "--profile", "default", "--", "sleep", "0.1") + cmd1 := exec.Command(binaryPath, "--profile", "default", "--", "sleep", "1.0") cmd1.Env = append(os.Environ(), fmt.Sprintf("XDG_RUNTIME_DIR=%s", tmpRuntimeDir)) if err := cmd1.Start(); err != nil { t.Fatalf("Failed to start cmd1: %v", err) @@ -88,7 +88,7 @@ func TestNamespaceLifecycleAutomation(t *testing.T) { waitForLifecycle(t, binaryPath, tmpRuntimeDir, "default", true) // Start a second process using the same profile - cmd2 := exec.Command(binaryPath, "--profile", "default", "--", "sleep", "0.1") + cmd2 := exec.Command(binaryPath, "--profile", "default", "--", "sleep", "1.0") cmd2.Env = append(os.Environ(), fmt.Sprintf("XDG_RUNTIME_DIR=%s", tmpRuntimeDir)) if err := cmd2.Start(); err != nil { t.Fatalf("Failed to start cmd2: %v", err) |
