Repository navigation
Test the ssh host listing without children racing the ssh -G deadline - #734
Merged
Merged
Conversation
…n racing the ssh -G deadline The scheduling test ran twelve stand-in ssh scripts against the three-second RESOLVE_DEADLINE, so a host loaded enough to delay one child failed it with TimedOut. Asking where an alias leads is now a Resolve: production passes ssh_g, the real ssh -G, and the tests decide each answer. The command ssh -G runs and the answer each way it can end are checked as values, and the runtime test of the host list uses decided answers too; the missing-program case keeps the real path, which fails at start without a deadline.
The gh tests that also wrote their stand-in through it moved to hide-host with its own copy, and the ssh -G tests no longer run a stand-in.
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.
Closes #728
Summary
resolving_runs_a_bounded_number_of_children_and_asks_each_alias_once는 stand-insshscript 12개를 제품의 3초RESOLVE_DEADLINE아래 실제 child로 돌렸다.host가 바빠 child 하나가 3초 안에 끝나지 못하면
TimedOut으로 실패했다(#728, load 55-67).같은 방식이 Add device host list의 runtime test에도 있었다.
이제 alias가 어디로 가는지 묻는 일은
Resolve(herdr-core/src/ssh_hosts.rs)다. 제품은 실제ssh -G인ssh_g를 넘기고, test는 답을 정한다.listing의 규칙(한 번에 4개까지, alias마다 한 번, 순서)과 host list의 core 규칙은 child도 시계도 없이 검사하고,
ssh -G가 무엇을 실행하는지와 끝나는 방식마다 어떤 답이 되는지는 값으로 검사한다.제품 동작, deadline, 동시 실행 수는 바뀌지 않았다.
Review
herdr-core/src/ssh_hosts.rs-resolve_one을command(실행할ssh -F <config> -G -- <alias>)와answer(실행 결과를Problem으로)로 나눴다. 매핑은 그대로다.herdr-core/src/runtime.rs-ssh_program: PathBuf가ssh_resolve: Resolve가 됐다. 기본값은ssh_g("ssh")로 이전과 같은 program을 쓴다.ssh -G를 끝까지 돌리는 test는 이제 하나다(없는 program, 시작에서 바로 실패해 deadline과 무관). stand-in이 받은 argv를 보던 검사는Command의 program, argv,HOME을 직접 보는 검사로 옮겼다.Evidence
h7)가 아무도 쓰지 않는 FIFO를cat해 끝나지 않게 하면, 이슈와 같은 assertion에서TimedOut으로 실패한다(3.7초).kill -STOP으로 먼저 해 봤지만, 멈춘 child는 deadline 전에SshFailed로 끝나 느린 child를 흉내 내지 못했다. 그래서 FIFO로 바꿨다.verify-cargo.sh nextest -p herdr-core1642/1642 통과,fmt-check,clippy -p herdr-core --all-targets -D warnings통과.resolving_asks_each_alias_once_from_a_bounded_number_of_workers_in_order(worker 수가 4 이하, alias마다 한 번, 순서),a_raised_stop_asks_no_alias,ssh_g_names_the_accounts_own_config_and_home,each_way_ssh_g_can_end_has_one_answer.remote::tests::sparse_remote_wire_snapshot_requires_typed_bootstrap_for_events가 LEAK로 표시됐다(통과).