Repository navigation
test: own a bounded child's Windows tree in a job object from its start - #1855
Merged
Merged
Conversation
runBounded on Windows found a child's tree from process snapshots taken after the spawn, which missed a grandchild whose parent had exited and failed a child that exited before its identity was read. hide-processes run now puts the child in a job object before its first instruction, ends the job however the run ends and reports once none of it is left. Its own first compile, before there is a hide-processes, runs in steps that each start no other process. Closes with-hide/hide-private#324
A Windows desktop window sometimes missed its shell for 30 s in the middle of a job while its daemon had started, and nothing said which step stopped. The fixture's waits for the shell now record the host log's last lines, each window as the main process sees it and each page's requests.
…y failure to follow it The program was created suspended and joined its job afterwards, so a launcher that died in between left it outside the job, and a failed event, thread, wait or exit-status read ended the run without saying why. The program is now created in the job (PROC_THREAD_ATTRIBUTE_JOB_LIST), what the run waits on is ready before it starts, and a failure after the start still ends and counts the job and reports its Win32 error. The first compile runs without the variables that would have clang start cc1 as a second process.
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#324
Related: with-hide/hide-private#328, with-hide/hide-private#326, #1841
Summary
Windows 테스트 도우미
runBounded가 자식 프로세스 트리 일부를 놓치던 문제(#324)를 고칩니다.이제 자식을 시작하는 순간 Windows Job object에 넣고(
hide-processes run), 끝날 때 job이 빌 때까지 확인합니다.나중에 프로세스 목록을 다시 읽어 트리를 찾던 방식은 없어졌습니다.
#328(창이 셸을 30초 못 그림)은 다음에 실패할 때 어느 단계가 멈췄는지 남도록, 실패 때만 기록을 남깁니다.
#1841의 Windows 7.4초는 종료 결함이 아니었습니다(Evidence).
스크린샷 없음: 테스트 도우미와 fixture만 바뀌고 제품 화면은 바뀌지 않습니다.
Review
hide-processes자신)은 아직 job을 만들 도구가 없어, 프로세스 하나짜리 단계로 나눴습니다:clang -c, 그리고 clang이-###로 알려 준 lld-link 한 번.clang -o한 번은 clang이 link.exe와 vctip.exe를 자식으로 띄워 #324의 경우 1이 그대로 남습니다.Add-Typejob은 csc.exe 자식과 수십 초 cold start가 붙습니다.runBounded는 그것만 씁니다. 남는 것은 그 한 번의 빌드라 단계 분리를 골랐고, Windows unit suite가 세 단계가 각각 프로세스 1개임을 job으로 셉니다.web/e2e/shims/hide-processes.c- 프로그램을 job 안에서 만드는 것(PROC_THREAD_ATTRIBUTE_JOB_LIST), 받은 인자를 그대로 넘기는after_argument, 상속 handle을 stdout/stderr/NUL로 제한한 것, job을 다시 끝내며 비었는지 세는 루프.unstarted, 시작 뒤 wait나 exit status 읽기가 실패하면 job을 끝내고 빈 것을 확인한 뒤failed, job을 끝내거나 셀 수 없으면unconfirmed로 Win32 오류와 함께 보고합니다.CC_PRINT_PROC_STAT,CLANG_SPAWN_CC1,CCC_OVERRIDE_OPTIONS를 뺀 환경에서, 기본 config 파일을 읽지 않고(--no-default-config, 컴파일과-###계획 둘 다) 돕니다. Windows 테스트가 변수 둘과-fproc-stat-report를 켠clang.cfg(clang이 먼저 찾는 폴더)를 둔 채 세 단계가 각각 프로세스 1개인지 세고, 같은 config로--no-default-config없이 컴파일하면 프로세스가 2개 이상인 것도 확인합니다.web/e2e/bounded-child.ts- Windows의 끝내기가 launcher 보고를 기다리는 비동기로 바뀜(30초 상한). worker exit 때는 launcher 입력을 닫아 job을 끝내게 하고, launcher가 죽으면KILL_ON_JOB_CLOSE가 끝냅니다.desktop/e2e/fixture.ts- 셸 대기가 실패할 때만 host 로그 끝 40줄, 창 상태, 페이지의 요청과 status를[failure dump] shell wait로 남깁니다. 요청 실패 이유는 남기지 않습니다. 각 비동기 읽기는 5초 상한(host 로그 읽기는 동기).Evidence
bounded-child.unit.ts9개 통과: 부모가 먼저 끝난 손자(job이 3개를 셈), 바로 끝나는 child(1개), 없는 프로그램, 첫 컴파일 단계 hang, 첫 컴파일 세 단계가 각각 1개(CC_PRINT_PROC_STAT,CCC_OVERRIDE_OPTIONS,-fproc-stat-report를 켠clang.cfg를 둔 채). 같은 config로--no-default-config없이 컴파일하면 프로세스가 2개 이상이어서, config가 실제로 읽히는 조건에서 막힌 것입니다.-###: 같은clang.cfg에서--no-default-config가 없으면Configuration file만 찍히고(in-process)가 없고, 있으면(in-process).hide browser open --wait가loading) 증상으로 두 번 실패했고, attempt 2에서 19개 통과. 이 실패는 #221에 기록됐고 이 PR이 건드리지 않는 경로입니다.expected true to be false로 실패합니다.ssh -V,ssh -G)에 든 6161 ms입니다. 종료는 ssh killafter_ms 3, 0.5초 미만.hide connect2.7초, 가장 긴 단계 0.2초(runs 40961007929, 40773892418). 24초는 debug 빌드였습니다. 이슈에 남기고 열어 둡니다.Verification record
vitest run e2e/bounded-child.unit.ts e2e/platform-program.unit.ts9 passed 1 skipped (Windows-only); web/desktop typecheck, lint 통과;hide-processes.czig cc(x86_64-windows-gnu)-Wall -Wextra경고 없음(pragma 제외)