Repository navigation
test: let the device writer take its lock while a test waits for its lines - #1828
Merged
Merged
Conversation
…lines A test waiting for the gated link's lines polled by parsing every line under the lock the writer takes for each line it writes, so on Linux the writer could not get the lock past the wait. The wait now sleeps until the link takes a line, copies only the new lines under the lock and parses each once, and its condition reads only the last line. Closes with-hide/hide-private#164 Closes with-hide/hide-private#143
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#164
Closes with-hide/hide-private#143
Summary
Linux CI에서
a_pane_past_its_unsent_keys_reads_ended_while_other_panes_keys_go_on가 5 s 대기 끝에 실패하던 원인을 고칩니다.테스트의 기다림이 잠금을 쥔 채 링크가 받은 줄 전부(16 KiB 키 줄 17개)를 매번 다시 파싱했고, writer는 줄마다 같은 잠금이 필요해 그 잠금을 얻지 못하고 굶었습니다.
이제 기다림은 링크가 줄을 받을 때까지 잠들고, 새 줄만 잠금 안에서 복사해 밖에서 한 번씩 파싱하며, 조건은 마지막 줄만 봅니다.
같은 파일의 link 대기 9곳을 이 기다림으로 바꿨습니다. 제품 코드와 대기 시간(WAIT)은 바뀌지 않습니다.
#1817(읽기를 cap overflow 전에 시작한 순서 문제)과는 다른 원인입니다.
Review
hide-node/src/terminal/device_tests.rs-GatedLink::wait_for_lines가written잠금과 새wroteCondvar를 씁니다.Evidence
written잠금을 기다린 시간이 대기 전체와 거의 같았습니다(예: 대기 53 ms 중 테스트가 쥔 시간 44 ms, writer가 기다린 시간 43 ms).verify-cargo.sh fmt-check,clippy -p hide-node --all-targets -D warnings,nextest -p hide-node(224 통과).Verification record
target/debug/deps/hide_node-* --exact terminal::device::tests::a_pane_past_its_unsent_keys_reads_ended_while_other_panes_keys_go_on병렬 반복