fix(tests): resolve nox unit_tests timeout for agent_skills_loader and skill_search features
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 52s
CI / security (pull_request) Successful in 53s
CI / e2e_tests (pull_request) Successful in 2m13s
CI / coverage (pull_request) Successful in 5m35s
CI / integration_tests (pull_request) Successful in 6m40s
CI / unit_tests (pull_request) Successful in 7m38s
CI / docker (pull_request) Successful in 1m45s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 16s
CI / quality (push) Successful in 17s
CI / build (push) Successful in 23s
CI / helm (push) Successful in 24s
CI / typecheck (push) Successful in 53s
CI / security (push) Successful in 53s
CI / push-validation (push) Successful in 38s
CI / e2e_tests (push) Successful in 3m14s
CI / unit_tests (push) Successful in 6m37s
CI / integration_tests (push) Successful in 6m39s
CI / docker (push) Successful in 12s
CI / coverage (push) Successful in 10m53s
CI / status-check (push) Successful in 1s
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 52s
CI / security (pull_request) Successful in 53s
CI / e2e_tests (pull_request) Successful in 2m13s
CI / coverage (pull_request) Successful in 5m35s
CI / integration_tests (pull_request) Successful in 6m40s
CI / unit_tests (pull_request) Successful in 7m38s
CI / docker (pull_request) Successful in 1m45s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 16s
CI / quality (push) Successful in 17s
CI / build (push) Successful in 23s
CI / helm (push) Successful in 24s
CI / typecheck (push) Successful in 53s
CI / security (push) Successful in 53s
CI / push-validation (push) Successful in 38s
CI / e2e_tests (push) Successful in 3m14s
CI / unit_tests (push) Successful in 6m37s
CI / integration_tests (push) Successful in 6m39s
CI / docker (push) Successful in 12s
CI / coverage (push) Successful in 10m53s
CI / status-check (push) Successful in 1s
Adjusted test running and file-detection logic to stabilize unit tests in overlayfs environments and improve target feature handling. - Modified scripts/run_behave_parallel.py to run sequentially when there are 2 or fewer feature files, avoiding fork deadlocks on overlayfs and reducing nox-based unit test timeouts for agent_skills_loader and skill_search features. - Updated noxfile.py to correctly detect feature files in posargs, fixing the prior logic that appended the "features/" directory when specific feature files were provided. This ensures precise test selection and avoids unnecessary path expansion. Rationale: These changes address the root causes of flaky unit test timeouts by preventing problematic forking behavior with small feature sets and by ensuring nox respects explicitly provided feature file paths. ISSUES CLOSED: #9374
This commit was merged in pull request #9456.
This commit is contained in:
+5
-3
@@ -173,8 +173,9 @@ def unit_tests(session: nox.Session):
|
||||
behave_cmd = session.bin + "/behave-parallel"
|
||||
parallel_args = _behave_parallel_args(session.posargs)
|
||||
|
||||
# If a specific feature file is passed, run only that file
|
||||
if session.posargs and session.posargs[0].endswith(".feature"):
|
||||
# If specific feature files are passed, run only those files
|
||||
has_feature_files = any(arg.endswith(".feature") for arg in session.posargs)
|
||||
if has_feature_files:
|
||||
args = [
|
||||
behave_cmd,
|
||||
"-q",
|
||||
@@ -562,7 +563,8 @@ def coverage_report(session: nox.Session):
|
||||
|
||||
# Build behave-parallel args (sequential for coverage).
|
||||
behave_cmd = session.bin + "/behave-parallel"
|
||||
if session.posargs and session.posargs[0].endswith(".feature"):
|
||||
has_feature_files = any(arg.endswith(".feature") for arg in session.posargs)
|
||||
if has_feature_files:
|
||||
behave_args = [
|
||||
behave_cmd,
|
||||
"-q",
|
||||
|
||||
@@ -337,7 +337,18 @@ def main(argv: list[str] | None = None) -> None:
|
||||
|
||||
start = time.monotonic()
|
||||
|
||||
if processes <= 1 or coverage_mode or len(feature_paths) == 1:
|
||||
# Run sequentially if:
|
||||
# - processes <= 1 (explicitly requested)
|
||||
# - coverage_mode (slipcover requires single process)
|
||||
# - only 1 feature file (no parallelism benefit)
|
||||
# - very few feature files relative to processes (fork overhead > benefit)
|
||||
# When feature_paths <= 2, sequential is faster and avoids fork deadlocks
|
||||
if (
|
||||
processes <= 1
|
||||
or coverage_mode
|
||||
or len(feature_paths) == 1
|
||||
or len(feature_paths) <= 2
|
||||
):
|
||||
# ---- sequential in-process mode ----
|
||||
_, total = _run_features_inprocess(feature_paths, other_args)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user