Skip to content

test: cover split, rollover and killed-process sidecars (D4-C) - #21

Merged
wt159 merged 1 commit into
mainfrom
test/d4c-lifecycle
Nov 9, 2026
Merged

wt159 merged 1 commit into
mainfrom
test/d4c-lifecycle

Conversation

@wt159

@wt159 wt159 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

补齐设计文档 §8 里剩下的生命周期用例。

  • split:把文件上限调到 10 字节,写两段 → 两个 .pcm 各一份 sidecar,split_index 分别为 0/1,都是 complete
  • rollover:间隔 2.2 秒再写 → 新 session 新文件,两份 sidecar 都 complete 且 generation 不同
  • 无 stop():隔离子进程写入后直接 _exit(),父进程检查残留 sidecar 为 complete=false 且没有 total_bytes

只读目录那条(S-08)没加:现有的 write-failure 用例已经证明 sidecar 写失败不会外溢,重复覆盖收益低。

预计新增约 2.7 秒(主要来自 rollover 的 2.2 秒等待)。

Three lifecycle cases from the design's test plan:

- split: shrunken size limit forces two files, each with its own sidecar and
  split_index 0/1;
- rollover: a 2.2s gap starts a new session, so both files have complete
  sidecars with different generations;
- no stop(): an isolated child writes and _exit()s, leaving the initial
  sidecar behind with complete=false and no total_bytes.

The read-only directory case is dropped: the existing write-failure test
already proves sidecar IO errors do not propagate.
@wt159
wt159 merged commit a9aa8b2 into main Nov 9, 2026
2 checks passed
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