Skip to content

Commit

Permalink
Terminate Indexify processes in the end of GH Action test runs
Browse files Browse the repository at this point in the history
Currently we don't cleanely terminate Indexify Server and Executor
in the end of test runs. This results in a misleading collection
of many orphaned processes in the end of test runs. Do the clean
termination to remove the misleading orphaned processes collection
and to run the code in Executor that terminates Function Executors
cleanely. This ensures better line coverage in our CI GH Actions
testing.
  • Loading branch information
eabatalov committed Dec 16, 2024
1 parent 5eae3fa commit 401e549
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
run: |
chmod u+x ./indexify-server
RUST_LOG=debug ./indexify-server &
echo $! > /tmp/indexify-server.pid &
wait-on: |
tcp:localhost:8900
Expand All @@ -130,6 +131,7 @@ jobs:
run: |
cd python-sdk
poetry run indexify-cli executor &
echo $! > /tmp/indexify-executor.pid &
wait-on: |
tcp:localhost:8900
Expand Down Expand Up @@ -158,12 +160,31 @@ jobs:
sleep 5
fi
done
- name: Run All Tests
run: |
cd python-sdk
export INDEXIFY_URL=http://localhost:8900
make test
- name: Terminate processes
# We want to test clean termination of processes.
run: |
pkill -SIGTERM -F /tmp/indexify-server.pid
pkill -SIGTERM -F /tmp/indexify-executor.pid
- name: Wait for processes termination
run: |
pid_files="/tmp/indexify-server.pid /tmp/indexify-executor.pid"
for pid_file in $pid_files; do
while pkill -0 -F "$pid_file" 2>/dev/null; do
echo "waiting for process $pid_file to exit..."
sleep 1
done
done
- name: Validate that all processes terminated
run: |
if pgrep -f indexify; then
echo "Error: Some Indexify processes are still running."
exit 1
fi
last_release_acceptance_tests:
name: 'Last Release Acceptance Tests (trigger with label: ci_compat_test)'
Expand Down Expand Up @@ -198,6 +219,7 @@ jobs:
run: |
chmod u+x ./indexify-server
RUST_LOG=debug ./indexify-server &
echo $! > /tmp/indexify-server.pid &
wait-on: |
tcp:localhost:8900
Expand All @@ -213,6 +235,7 @@ jobs:
run: |
cd python-sdk
poetry run indexify-cli executor &
echo $! > /tmp/indexify-executor.pid &
wait-on: |
tcp:localhost:8900
Expand Down Expand Up @@ -241,9 +264,28 @@ jobs:
sleep 5
fi
done
- name: Run All Tests
run: |
cd python-sdk
export INDEXIFY_URL=http://localhost:8900
make test
make test
- name: Terminate processes
# We want to test clean termination of processes.
run: |
pkill -SIGTERM -F /tmp/indexify-server.pid
pkill -SIGTERM -F /tmp/indexify-executor.pid
- name: Wait for processes termination
run: |
pid_files="/tmp/indexify-server.pid /tmp/indexify-executor.pid"
for pid_file in $pid_files; do
while pkill -0 -F "$pid_file" 2>/dev/null; do
echo "waiting for process $pid_file to exit..."
sleep 1
done
done
- name: Validate that all processes terminated
run: |
if pgrep -f indexify; then
echo "Error: Some Indexify processes are still running."
exit 1
fi

0 comments on commit 401e549

Please sign in to comment.