Repository navigation
Make the core runtime tests wait through one named helper - #512
Merged
Merged
Conversation
The runtime test modules share the wait and wait_for helpers that were home.rs's own, instead of loops written inline in each test. The stale device read waits for the open's workers to hand their answers over, and the missed home link waits for the helper's connect attempt to end, instead of 200 ms each.
… test The read answer that comes back after its request was replaced or forgotten with its device is now a file.open_dropped diagnostic carrying the open's generation. The device removal test waits for it instead of counting the runtime's weak references, which no caller can observe.
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.
Refs #437
Summary
herdr-core/src/runtime/tests/의 #437 allow 13개를 없앱니다. 제품 변경은 진단 하나입니다(아래file.open_dropped).home.rs에만 있던wait(shared, what, ready)와wait_for(what, ready)를 부모 모듈runtime/tests.rs로 옮겨 runtime 테스트 모듈 모두가 씁니다(새 helper가 아니라 이동).view_areas3개,device_catalog2개,project_sessions2개,terminal2개,documents1개가 테스트 안에 따로 쓰던 polling 루프를 이것으로 바꿨습니다.device_catalog의 나머지 하나는 같은 파일의next_request를 씁니다.documents.rsa_device_read_that_lands_after_the_device_was_removed_opens_nothing: 200ms 대신, 늦게 온 읽기 답이 버려졌다는 진단file.open_dropped를 기존diagnostic_count로 기다린 뒤 탭이 없음을 봅니다.ingest_document_open이 바뀌었거나(새 요청) 장치와 함께 잊힌 요청의 답을 버리는 자리에push_diagnostic("file.open_dropped", ...)를 더했습니다. 메시지는file.open_requested가 남긴 generation만 담고 경로나 내용은 담지 않습니다.home.rsa_link_change_missed_while_the_helper_reconnects...: 200ms 대신, 20번의 쓰기가 요청한 helper 연결 한 번이 끝났다(device_host_connecting이 false)는 상태를 기다린 뒤 "아무것도 닿지 않았다"를 봅니다.Review
file.open_dropped는 다른push_diagnostic종류처럼 snapshot의 최근 진단 목록에 들어가므로 Settings > General의 진단 목록(최근 8개)과 Copy diagnostics에도 보입니다. 알림이나 배너는 아닙니다. 버려지는 답은 장치 제거나 같은 탭의 새 open 뒤에만 생겨서 드뭅니다. 이 kind를 이름으로 적은 guide는 없습니다(file.open_requested도 없음).herdr-core/src/runtime/documents.rsingest_document_open- 반환값과 순서는 그대로이고, 버리는 분기에 진단 한 줄만 더했습니다. 처음엔 weak count로 worker 끝을 봤으나, 호출자가 볼 수 없는 내부 수명이라 관찰 가능한 결과(진단)로 바꿨습니다.herdr-core/src/runtime/tests.rs- 옮긴 helper의 한도는 10초(home.rs 그대로)라서, 5초 한도로 쓰던 inline 루프보다 hang guard가 깁니다. 단정은 같습니다.Evidence
forget_device_opens가 snapshot의opening만 비우고 요청은 남기게 바꾸자 stale read 테스트가file.open_dropped를 기다리다 실패, 되돌리면 통과(진단 commit 뒤 다시 확인).runtime::671개 통과(macOS), clippy-D warnings통과.yes4개 +taskpolicy -b)에서 수정 전과 후 binary로 바꾼 13개를 한 번에: 40/40 대 40/40(매 회 13개 실행 확인).a_device_read_that_lands_after_the_device_was_removed_opens_nothing만 같은 부하에서 수정 전과 후 binary를 번갈아 30번씩: 30/30 대 30/30.verify-cargo.sh clippy -p herdr-core --all-targets -D warnings,fmt, 바꾼 6개 모듈 136개 통과(macOS).