Skip to content

Commit fbc950b

Browse files
committed
fix: use shell script wrapper in e2e workflow and safer cleanup pattern
- Update e2e-test.yml to use ./scripts/run_e2e_tests.sh wrapper - Use more specific pkill pattern (concord_e2e[0-9]+@) to avoid killing test runner - Safer cleanup that only targets node processes, not the test runner
1 parent 53e27e2 commit fbc950b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Run E2E Distributed Tests
6161
run: |
6262
echo "Running e2e distributed tests with manual node spawning..."
63-
MIX_ENV=e2e_test elixir --name test@127.0.0.1 --cookie concord_e2e_test -S mix test e2e_test/distributed/ --trace
63+
./scripts/run_e2e_tests.sh e2e_test/distributed/
6464
env:
6565
MIX_ENV: e2e_test
6666

e2e_test/support/e2e_cluster_helper.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ defmodule Concord.E2E.ClusterHelper do
143143
# Give time for graceful shutdown
144144
Process.sleep(500)
145145

146-
# Force kill any remaining processes
147-
System.cmd("pkill", ["-9", "-f", "concord_e2e"], stderr_to_stdout: true)
146+
# Force kill any remaining node processes (use specific pattern)
147+
System.cmd("pkill", ["-9", "-f", "concord_e2e[0-9]+@"], stderr_to_stdout: true)
148148

149149
# Clean up data directories
150150
cleanup_data_dirs()

e2e_test/test_helper.exs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Clean up orphan processes from previous runs
2+
# Only kill node processes, not the test runner
23
defmodule Concord.E2E.Cleanup do
34
def kill_orphans do
45
IO.puts("Cleaning up orphan e2e processes...")
5-
System.cmd("pkill", ["-9", "-f", "concord_e2e"], stderr_to_stdout: true)
6+
# Use more specific pattern to only kill node processes (concord_e2e\d+@)
7+
System.cmd("pkill", ["-9", "-f", "concord_e2e[0-9]+@"], stderr_to_stdout: true)
68
Process.sleep(500)
79
end
810
end
@@ -45,7 +47,8 @@ end
4547
# Register cleanup on exit
4648
System.at_exit(fn _ ->
4749
IO.puts("\nCleaning up e2e processes on exit...")
48-
System.cmd("pkill", ["-9", "-f", "concord_e2e"], stderr_to_stdout: true)
50+
# Use specific pattern to only kill node processes
51+
System.cmd("pkill", ["-9", "-f", "concord_e2e[0-9]+@"], stderr_to_stdout: true)
4952
end)
5053

5154
# Start ExUnit with specific configuration for e2e tests

scripts/run_e2e_tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ NC='\033[0m' # No Color
1313
# Set MIX_ENV
1414
export MIX_ENV=e2e_test
1515

16-
# Function to clean up orphan processes
16+
# Function to clean up orphan node processes
1717
cleanup() {
1818
echo -e "\n${YELLOW}Cleaning up e2e processes...${NC}"
19-
pkill -9 -f "concord_e2e" 2>/dev/null || true
19+
# Use specific pattern to only kill node processes (concord_e2e1@, concord_e2e2@, etc.)
20+
pkill -9 -f "concord_e2e[0-9]+@" 2>/dev/null || true
2021
rm -rf ./data/e2e_test 2>/dev/null || true
2122
}
2223

0 commit comments

Comments
 (0)