Repository navigation
Make the platform ipc and watch tests wait for the peer instead of a time - #509
Merged
Merged
Conversation
…time A silent or late peer now holds its end on a channel the test releases, the drop-with-unread-bytes test leaves its last bytes unread until the listener's end is gone, and the filtered burst is paced by a kept path's arrival. The three tests about a call freed while it is blocked keep their 300 ms, now only after the thread says it is about to block, under an allow that names why: no portable state says a thread is inside a system call.
The three tests that free a blocked accept or read leave the last step into the call to the scheduler, so the same answer when the close or shutdown lands first is what keeps them from failing on a slow runner.
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
hide-platform의 ipc와 watch 계약 테스트 9개에서 #437 allow를 없앱니다. 6개는 시간 대신 상태를 기다리고, 3개는 감독 결정에 따라 고유 이유의 allow로 재분류했습니다. 제품 코드는 바뀌지 않았습니다.상태를 기다리게 바꾼 것:
a_read_timeout_fires...,the_accepted_stream_names...: 상대가 1.5초/0.5초 자며 연결을 쥐던 것을, 테스트가 채널로 놓아 줄 때까지 쥐게 했습니다(10초는 실패 경로의 한도).a_timeout_does_not_lose_bytes...: 상대가 500ms 뒤가 아니라 클라이언트의 read가 timeout된 뒤에 씁니다.an_answer_written_just_before_the_end_is_dropped...: 300ms 대신, 클라이언트가 마지막 256바이트를 읽지 않은 채 listener 쪽이 쓰기를 끝내고 drop했다는 신호를 받은 뒤 나머지를 읽습니다. "읽지 않은 바이트가 남은 채 닫힘"이 이제 매번 일어납니다(256 < Windows pipe 512 요청, Unix socket buffer).a_timeout_can_be_set_after_the_peer_has_closed...:join뒤의 200ms를 지웠습니다. Unix stream은 drop에서 descriptor를 닫으므로 join이 곧 "상대가 닫힘"입니다.watch.rsa_filtered_watch...: 100개마다 20ms 대신, 필터가 남기는refs/pace*파일을 쓰고 그 보고를 기다립니다. 시스템은 순서대로 보고하므로 그 앞의 100개는 읽혔습니다.Review
close_from_another_thread_frees_a_blocked_accept,shutdown_from_another_thread_frees_a_blocked_read,shutdown_frees_a_read_that_has_a_timeout_too. 대상이 "막힌 syscall을 깨우는 경로"인데 thread가 syscall 안에서 막혔다는 상태를 이식 가능하게 볼 방법이 없습니다. allow 이유를 "time for the other thread to block in the call it frees: no portable state says a thread is inside a system call"로 바꿨고, thread가 accept/read 직전에 보내는 신호를 받은 뒤에만 300ms를 잡니다(길이는 그대로, thread 시작 시간은 덮지 않음). 상대를 10초 sleep으로 쥐던 것은 채널로 바꿨습니다.a_close_before_the_accept...,a_shutdown_before_the_read..., timeout 있음/없음). OS contract lane이 세 시스템에서 돌립니다. 테스트를 늘린 것이 괜찮은지.hide-platform/tests/watch.rs- 이제 pace 파일 26개의 보고를 각각 기다립니다(각 2초 한도). 보고가 늦은 시스템에서는 실패가 "a kept path ... was not reported"로 나옵니다.Evidence
yes4개 +taskpolicy -b)에서 수정 전과 후 binary를 같은 조건으로: ipc 바꾼 8개 60/60 대 60/60, watch 30/30 대 30/30, 새 순서 테스트 2개 60/60(macOS). 매 run의N passed로 test가 실제로 돌았는지 확인했습니다(ipc run당 8개, 순서 2개, watch 1개).ConnectionAborted, read는Ok(0), 뒤의 write는 실패로 같은 답(macOS). Linux와 Windows는 이 PR의 OS contract lane으로 봅니다.verify-cargo.sh clippy -p hide-platform --all-targets -D warnings,fmt,test-scoped -p hide-platform --test ipc --test watch통과.