From a9728835e5fc6730466dfbaa3c026559c062e631 Mon Sep 17 00:00:00 2001 From: dawn <90008@klbr.net> Date: Wed, 9 Sep 2026 17:17:54 +0300 Subject: [PATCH] [tests] fix nushell process termination flags and api_xrpc debug port --- tests/api_xrpc.nu | 3 ++- tests/crawler_by_collection.nu | 8 ++++---- tests/helpers/authenticated_stream.nu | 8 ++++---- tests/signal_filter.nu | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/api_xrpc.nu b/tests/api_xrpc.nu index ab8ce80..ce4b083 100755 --- a/tests/api_xrpc.nu +++ b/tests/api_xrpc.nu @@ -113,7 +113,8 @@ def test-host-endpoints [url: string, seed: record] { def main [] { let port = resolve-test-port 3024 let url = $"http://localhost:($port)" - let debug_url = $"http://localhost:($port + 1)" + let debug_port = (resolve-test-debug-port ($port + 1)) + let debug_url = $"http://localhost:($debug_port)" let db_path = (mktemp -d -t hydrant_api_xrpc.XXXXXX) let binary = build-hydrant let instance = (with-env { diff --git a/tests/crawler_by_collection.nu b/tests/crawler_by_collection.nu index 4ea912e..0f20ed2 100644 --- a/tests/crawler_by_collection.nu +++ b/tests/crawler_by_collection.nu @@ -48,7 +48,7 @@ def main [] { if not (wait-for-api $url) { print "ERROR: hydrant failed to start" - try { kill -9 $instance.pid } + try { kill -f $instance.pid } rm -rf $db_path exit 1 } @@ -58,7 +58,7 @@ def main [] { print $"filter state: ($filter | to json)" if not ($filter.signals | any { |s| $s == $collection }) { print $"FAILED: ($collection) not in signals, filter not configured" - try { kill -9 $instance.pid } + try { kill -f $instance.pid } rm -rf $db_path exit 1 } @@ -81,7 +81,7 @@ def main [] { if not $discovered { print "FAILED: collection-index did not discover any repos within timeout" - try { kill -9 $instance.pid } + try { kill -f $instance.pid } rm -rf $db_path exit 1 } @@ -109,7 +109,7 @@ def main [] { } print "stopping hydrant..." - try { kill -9 $instance.pid } + try { kill -f $instance.pid } rm -rf $db_path if $test_passed { diff --git a/tests/helpers/authenticated_stream.nu b/tests/helpers/authenticated_stream.nu index 4b4068f..c63064e 100644 --- a/tests/helpers/authenticated_stream.nu +++ b/tests/helpers/authenticated_stream.nu @@ -140,9 +140,9 @@ export def run-authenticated-stream-test [ if not (wait-for-backfill $url) { print "failed: backfill did not complete" print "stopping listener..." - try { kill -9 $stream_pid } + try { kill -f $stream_pid } print "cleaning up..." - try { kill -9 $instance.pid } + try { kill -f $instance.pid } return false } @@ -203,7 +203,7 @@ export def run-authenticated-stream-test [ let relevant_events = wait-for-auth-events $output_file 20 print "stopping listener..." - try { kill -9 $stream_pid } + try { kill -f $stream_pid } if ($output_file | path exists) { let content = (open $output_file | str trim) @@ -243,7 +243,7 @@ export def run-authenticated-stream-test [ } print "cleaning up..." - try { kill -9 $instance.pid } + try { kill -f $instance.pid } $test_passed } diff --git a/tests/signal_filter.nu b/tests/signal_filter.nu index dce1bc4..dd5f608 100644 --- a/tests/signal_filter.nu +++ b/tests/signal_filter.nu @@ -114,7 +114,7 @@ def main [] { } print "stopping hydrant..." - try { kill -9 $instance.pid } + try { kill -f $instance.pid } if $test_passed { exit 0 -- 2.51.2