Repository navigation
fix: remove the causes of the connected-node runtime test flakes - #1824
Merged
Merged
Conversation
…answer A confirmation pressed the moment a review's answer appeared was refused, because the worker freed its lane by a second lock after the answer. The node cleanup test now confirms from the announcement of the answer.
A read the deadline cut said nothing about the shell, yet it erased the failure before it, so a terminal that was never readable could end the wait as a timeout or with the cut request's own error.
The doorbell and watch producers passed on their own clocks beside the tests' own passes and could end a watch the test then read from the file.
…s decide their order
The cut rule moves into the wait's loop, which takes its clock and its read, so the tests decide when each read ends against the bound instead of a real socket and the wall clock; the 150 ms bound is back.
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 with-hide/hide-private#153
Closes with-hide/hide-private#152
Closes with-hide/hide-private#148
Closes with-hide/hide-private#218
Closes with-hide/hide-private#213
Closes with-hide/hide-private#227
Closes with-hide/hide-private#319
Closes with-hide/hide-private#159
Closes with-hide/hide-private#246
Closes with-hide/hide-private#186
Closes with-hide/hide-private#126
Summary
herdr-core의 연결 노드 runtime 테스트 11개가 가끔 실패하던 원인을 고쳤습니다.
대부분은 테스트가 순서를 직접 정하지 않아 백그라운드 작업이 끼어든 경우였고, 그중 둘은 제품 쪽 문제였습니다.
대기 시간을 늘리거나 재시도를 더하지 않았습니다.
with-hide/hide-private#274(doorbell 두 테스트)는 재현되지 않아 범위에서 뺐고, 원인 후보와 증거를 이슈에 남겼습니다.
스크린샷 없음: 화면을 바꾸지 않는 core와 테스트 변경입니다.
Review
제품 동작이 바뀌는 곳 (둘 다 수정 없이 실패하는 테스트로 증명, Evidence 참고):
herdr-core/src/worktree_cleanup.rsWorkerGuard,worker_ended- 정리 worker가 마지막 snapshot 전달과 lane 해제를 한 lock 안에서 합니다(전에는 lock 두 번).runtime/projects.rsconfirm_cleanup은 lane이 잡혀 있으면 확인을 거절하는데, 검토 답과 lane 해제 사이에 온 확인이 여기서 버려졌습니다(#152의 CI 로그: 10초 동안 제거 진단이 하나도 없음).Mutex<Runtime>아래 일: 늘지 않았습니다. 같은ingest_cleanup과cleanup_worker_finished(필드 하나를None으로)를 두 번의 lock 대신 한 번의 lock에서 합니다. 새 I/O, subprocess, 직렬화는 없고notify는 전처럼 lock 밖입니다.scripts/check-capability-readers-off-lock.sh통과.confirm_cleanup의cleanup_worker.is_some()거절은 이제 "검토가 아직 loading 중"일 때만 걸립니다. 그 주석을 고쳤습니다.herdr-core/src/runtime/terminal_input.rswait_with- 셸 대기의 반복이 시계와 한 번의 읽기를 받아 돌고, 마감에 걸쳐 끝난 읽기(결과가 무엇이든)는 결과로 치지 않아 마지막으로 끝난 읽기의 결과가 남습니다.shell_reads_keys는 main과 같습니다. 결과는terminal.input_shell_wait진단의outcome/reason에만 쓰이고, 키는 어느 경우든 그대로 써집니다.다음 둘은 지시서에 제품 변경 후보로 적혔지만 테스트 fixture만 바뀝니다: #218/#213의 held link(
runtime/tests/inbound.rs), #227/#319의 연결 전환(runtime/tests/links.rs).조심해서 볼 파일:
runtime/tests/inbound.rs- held link의 Herdr가 link가 풀릴 때까지connect에서 기다립니다(전에는 없는 socket이라 즉시 거절). 그 거절을 node session sync가 받아 테스트가 연결해 둔 node를 끊긴 상태로 덮었습니다. link를 쓰는 모든 테스트(inbound, hide_ai_devices)가 통과하지만, 끝까지 release를 쥔 테스트가 있으면 멈출 수 있는 구조라 봐 주세요. 이전의 10초 자동 종료(recv_timeout)는 없앴습니다.runtime/tests/node_issues.rs- 확인을 검토 답의 announcement 안에서 누릅니다(ChangeNotifier::announcing). 콜백 안의 panic은 삼켜지므로 값을 모아 밖에서 assert합니다.suggestions/worker.rshandled- 실행 중인 run이 없는 pen 명령의 거절 답을 barrier로 씁니다. 상태를 바꾸지 않는 명령이라 골랐습니다.docs/TESTING.md- The test decides the order와 Wait for state에 규칙 네 줄을 더했습니다.이슈별 원인과 처리 (main 8a865d8 기준)
runtime::delivery::tests::moved_terminal_keeps_…,remote_observation_without_a_local_socket_…Worker::spawn이 doorbell/watch producer를 띄워 자기 시계로 pass를 돌림. watch tick이 fixture의 옮겨진 child를 못 읽고 폴더가 없다고 보면 watch를 끝냄(watches.len()0,watches[0]index), store가 쓰는 중에 테스트가 파일을 읽음(ledger_unavailable, 로컬 재현)Worker::store로, 파일을 읽기 전에 store를 멈춤node_issues::a_node_s_merged_worktree_is_removed_…inbound::a_node_pane_s_hide_memory_reads_for_the_node_s_sessionsocket_missing답이 테스트가 넣은 session 뒤에 도착해 node를 끊김으로 바꿈(pane_not_connected, 실패 0.04초)inbound::a_moved_core_reads_its_own_kit_…checking이 되지 않음, dispatch 뒤 lock을 놓은 사이 답이 끝날 수 있음links::a_native_fork_keeps_state_changes_…(#227의 새 이름이 #319)pane.get이 옛 서버로 감ssh_hosts_list::the_host_list_names_each_alias_…loading을 못 봄suggestions::worker::tests::a_weak_line_waits_fourteen_quiet_days_…Wake처리 전에 움직여 run이 실제 3분 뒤로 밀리고 10초 대기가 끝남(로컬 재현)handled)memory_analysis::tests::a_linked_node_s_closed_session_…memory_hook테스트의 몫이고 뒤의 receipt 확인은 hook과 무관해 그대로terminal_input::tests::a_terminal_that_is_never_read_…Evidence
ledger_unavailable), Check design changes against a kept reference bundle #186 1/200, Replace the stall clock with a descendant badge and ancestor unread #126 1/200(a read: Timeout), 나머지 0/200.worktree_cleanup.rs와projects.rs만 main으로 되돌리면 새 순서의 node 테스트가 5/5a confirmation pressed on the answer is taken으로 실패. Check design changes against a kept reference bundle #186 - 반복의 잘림 분기 한 줄만 지우면a_read_the_bound_cuts_short_leaves_the_last_failure_as_the_reason이Timeout(기대Unreadable("link down"))으로 실패.verify-cargo.sh nextest -p herdr-core --retries 03437/3437 통과.verify-cargo.sh clippy -p herdr-core --all-targets -D warnings,fmt-check,check-capability-readers-off-lock.sh통과.Verification record
repeat.sh <bin> <tests> 200 24, 테스트 하나당 프로세스 하나, macOS arm64worktree.*진단 없음remote.session_unavailable socket_missing