Repository navigation
test(cli): no timeout decides a cli_scope test; finish keeps the environment - #2590
Merged
Merged
Conversation
…ronment Follow-up to #2589. No timeout decides a cli_scope test any more: - The status probe and the parent's client connect repeat an attempt that reaches a live but mute endpoint (a loaded runner answering slowly). A reply or a definite refusal decides. Each attempt keeps the API's finite 5 s budget. This replaces the 15 s status budget and the single 5 s connect. - The host child is reaped without a deadline (it used to get SIGKILL after 60 s). - The host child joins its version cohort with UINT64_MAX, which waits for locks but answers a conflicting holder at once (it used to have a 45 s deadline). A wedged child is left to the harness's per-suite ceiling. cli_scope_fixture_finish restored HOME, CBM_CACHE_DIR and SHELL even when start had failed before saving them, which unset them for every later test in the suite. It now restores only what start saved. New tests: - cli_scope_fixture_finish_keeps_env_after_an_early_failure fails on main at ASSERT(home_kept); - cli_scope_retries_a_mute_endpoint_until_it_answers checks the retry rule on scripted attempt outcomes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2589, test code only (
tests/test_cli.c).What
No timeout decides a
cli_scopetest. #2589 removed the 90 s readiness deadline. Four other timeouts could still turn a slow but healthy run into a failure:host_exit == -1waitpidwithout a deadlineUINT64_MAX: waits for locks, answers a conflicting holder at onceThe retry rule uses what the daemon API already reports. A failed status or connect still carries
muted_endpoint_holder_pid, which is nonzero only when a live process accepted the connection and didn't answer in time. Each attempt keeps the API's finite 5 s budget, so a mute endpoint is not spun in a hot loop. A wedged child is left to the harness's per-suite ceiling.cli_scope_fixture_finishkeeps the environment after an early setup failure. Everycli_scopetest callsfinish, even whenstartfailed. Astartthat failed before savingHOME,CBM_CACHE_DIRandSHELLhadfinish"restore" them to nothing, which unset them for every later test in the suite.finishnow restores only whatstartsaved.Not changed: the 2 s probe that checks an already-drained host has stopped serving (
CLI_SCOPE_HOST_DRAINED_PROBE_MS). It's recorded as a separate question. Thedaemon_*cohort fixture near the top of the file also keeps its own 45 s join.Tests
cli_scope_fixture_finish_keeps_env_after_an_early_failure: fails onmainatASSERT(home_kept)and passes with this change.cli_scope_retries_a_mute_endpoint_until_it_answers: checks the retry rule on scripted outcomes (mute, mute, mute, answered → true after 4 attempts; mute, refused → false after 2; answered → true after 1).cli_scopetests pass against a real host child.Checks
daemon_version daemon_application cli, macOS ASan): 444 passed, 0 failed.make lint-ciclean.scripts/test.sh): 9,137 passed, 0 failed, 11 skipped (177 suites);cli358/0run.sh test): 8,975 passed, 0 failed, 10 skipped (173 suites);cli359/0win.sh test, the runner's full 177-suite list): 8,961 passed, 0 failed, 91 skipped. Thecli_scopefixture is POSIX-only (it forks), so its tests are not built on Windows. Windows guards (CI'sTEST_SEAMS=1build): 8/8 green.