Skip to content

TEMP: desktop e2e failed attempt keeps the daemon log (do not merge) - #632

Closed
yansfil wants to merge 2 commits into
mainfrom
temp/desktop-hided-log-evidence
Closed

yansfil wants to merge 2 commits into
mainfrom
temp/desktop-hided-log-evidence

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Evidence run for the desktop e2e daemon-log diagnostic. Runs only the desktop e2e lane, only the keys.spec cycle test, with a forced failure, so the artifact shows what a failed attempt keeps. Closed and deleted after the run. Refs #629

yansfil added a commit that referenced this pull request Oct 6, 2026
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에서 한 번 회전하고, #629 같은 test 한
개의 log는 수십 KiB입니다.

## Evidence

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

Copy link
Copy Markdown
Contributor Author

TEMP evidence done: on the cleanup-time capture both attempts kept hided-1.jsonl (run 37451613232); on #633 alone neither did (run 37449504611). Closing and deleting the branch.

@yansfil yansfil closed this Oct 6, 2026
@yansfil
yansfil deleted the temp/desktop-hided-log-evidence branch October 6, 2026 10:58
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