Skip to content

Read the daemon log when a desktop e2e run is cleaned up - #636

Merged
yansfil merged 1 commit into
mainfrom
diag/desktop-e2e-log-at-cleanup
Oct 6, 2026
Merged

yansfil merged 1 commit into
mainfrom
diag/desktop-e2e-log-at-cleanup

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #629
Related: #633

Summary

#633(desktop e2e가 실패한 시도의 private hided log를 남김)이 실제로는 아무것도 남기지 못하던 것을 고칩니다. 진단만 바뀌고 제품과 test 동작은 그대로입니다.

  • 원인: #633은 test fixture의 teardown에서 log를 복사했습니다. 그런데 spec들은 자기 afterEach에서 run.cleanup()을 먼저 부르고(desktop spec 33곳), 그 cleanup이 run 폴더를 지워 teardown에는 읽을 log가 없었습니다.
  • 고침: isolate()의 cleanup이 hide stop 뒤, 폴더를 지우기 전에 그 run의 daemon log 끝을 읽어 둡니다. test fixture는 결과가 확정된 뒤 실패일 때만 그것을 그 시도의 test-results에 hided-<n>.jsonl로 씁니다.
  • 크기 cap(파일마다 끝 256 KiB, 잘린 첫 record는 버림)과 경로 placeholder(<run>, <repo>, <home>, <tmp>)는 Keep the private daemon's log for a failed desktop e2e attempt #633 그대로입니다. test 밖(worker의 afterAll)에서 부르는 cleanup은 읽지 않습니다.

Review

  • 조심해서 볼 파일: desktop/e2e/fixture.ts - failure path. 읽기 실패는 cleanup 오류로 모으고 다른 정리는 계속합니다. 통과한 test도 cleanup마다 log 끝(최대 256 KiB)을 한 번 읽고 버립니다.

Evidence

  • 확인한 것: desktop typecheck, lint(e2e test size budget 포함) 통과.
  • 확인한 것 (실패 시 남음): TEMP TEMP: desktop e2e failed attempt keeps the daemon log (do not merge) #632(do not merge)를 이 branch 위로 다시 돌렸습니다(run 37451613232, keys.spec cycle test 하나에 강제 실패, macOS desktop lane만). 첫 시도와 retry 각각의 test-results 폴더에 hided-1.jsonl(약 9.6 KB, 60줄)이 남았습니다.
  • 확인한 것 (내용): 60줄 모두 JSON으로 읽힙니다. /Users/, /private/var, /var/folders, runner 경로는 0건이고 token, secret, password, authorization 이름의 field도 0건입니다. tab.control.ready, tab.focus.late_answer, pane.read_record 같은 core 기록이 시간 순서대로 들어 있습니다.
  • 확인한 것 (#633이 남기지 못함): 같은 TEMP를 Keep the private daemon's log for a failed desktop e2e attempt #633 위에서 돌린 run 37449504611의 artifact에는 두 시도 모두 hided-*.jsonl이 없었습니다.

The log of a failed attempt was copied in the test fixture's teardown,
but specs clean their run up in their own afterEach, which runs first and
removed the folder, so nothing was kept. Each cleanup now reads the end
of its daemons' core logs, and the fixture writes them beside the report
once the test's outcome is final and only when it failed.

Refs #629
@yansfil
yansfil merged commit e95e543 into main Oct 6, 2026
13 checks passed
@yansfil
yansfil deleted the diag/desktop-e2e-log-at-cleanup branch October 6, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant