Skip to content

Keep the private daemon's log for a failed desktop e2e attempt - #633

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

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

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #629

Summary

desktop e2e가 실패한 시도에서 private hided의 core log를 남깁니다. 진단만 더하고 제품과 test 동작은 바뀌지 않습니다.

  • 문제: 실패한 시도는 host log(desktop.log)만 출력했고, hided의 Logs/core.jsonl은 run 폴더와 함께 지워졌습니다. #629는 그래서 core의 focus 순서 없이 Herdr log로만 분류해야 했습니다.
  • 고침: desktop fixture의 teardown이 시도가 실패했을 때만, 정리 전에 각 private daemon의 Logs/core.jsonl 끝을 그 시도의 test-results 폴더에 hided-<n>.jsonl로 복사합니다. CI의 hide-desktop-e2e-logs artifact가 이 폴더를 이미 올립니다.
  • 크기: 파일마다 끝 256 KiB, 잘린 첫 record는 통째로 버려 모든 줄이 JSON입니다. 잘렸으면 첫 줄에 e2e.log_tail(남긴 크기와 전체 크기)을 적습니다.
  • 민감값: run 폴더, repository, home, 임시 폴더 경로를 <run>, <repo>, <home>, <tmp>로 바꿉니다(JSON escape된 Windows 철자 포함). core log에는 token이나 credential을 쓰는 record가 없습니다.
  • docs/TESTING.md flaky 절에 한 문장을 더했습니다.

Review

  • 조심해서 볼 파일: desktop/e2e/fixture.ts - failure path. 복사는 앱을 닫은 뒤, hide stop과 폴더 삭제 전에 하고, 실패하면 teardown 오류로 모읍니다(다른 정리는 계속).
  • 판단해 주세요: 256 KiB가 충분한지. core log는 1 MiB에서 한 번 회전하고, Flaky test: cycles: ⌃Tab and ⌥Tab commit once, on releasing the held modifier #629 같은 test 한 개의 log는 수십 KiB입니다.

Evidence

  • 확인한 것: desktop typecheck, lint(e2e test size budget 포함) 통과. 바꾼 줄에 workstation identity 검사 통과.
  • 확인한 것 (실패 시 복사): TEMP PR TEMP: desktop e2e failed attempt keeps the daemon log (do not merge) #632(do not merge)가 keys.spec cycle test 하나에 일부러 실패를 넣어 macOS desktop lane만 돌립니다. 결과는 아래에 덧붙입니다.
  • 확인하지 못한 것: 통과한 시도는 아무것도 복사하지 않는다는 것은 코드의 조건(testInfo.status !== testInfo.expectedStatus)으로만 봤습니다. 이 PR의 CI desktop lane에서 녹색 run의 artifact가 없는 것으로 확인됩니다.

A failed desktop e2e attempt left only the host log, and the daemon's own
core log, with the order of its focus, tab and pane records, was removed
with the run's folders. The fixture now copies the end of each private
daemon's Logs/core.jsonl (at most 256 KiB, whole records) into the
attempt's test-results folder, with the run's folders, the repository,
the home and the temporary folder written as placeholders.

Refs #629
@yansfil
yansfil merged commit f2afa97 into main Oct 6, 2026
13 checks passed
@yansfil
yansfil deleted the diag/desktop-e2e-hided-log branch October 6, 2026 10:35
yansfil added a commit that referenced this pull request Oct 6, 2026
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>`)는 #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 #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를 #633 위에서 돌린 run 37449504611의
artifact에는 두 시도 모두 `hided-*.jsonl`이 없었습니다.
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