fix: tolerate transient status locks and document real BOM roundtrip validation

This commit is contained in:
阿白叔 committed 2026-10-15 18:22:33 +08:00
1 parent 9b2372e389
commit 65a72c6a3a
4 files changed
+502 -1

No files matched your search

+16
View File
@@ -22,3 +22,19 @@ def test_native_report_waits_for_reader_to_release_windows_replace_lock(tmp_path
finally:
timer.join()
assert report.read_text() == 'new complete report'
def test_status_read_waits_for_exclusive_windows_reader(tmp_path):
import win32file
import win32con
from dx_productivity.trial_task_center.quick_run import _open_status_for_read
status = tmp_path / 'status.tsv'
status.write_bytes(b'complete correlated status')
held = win32file.CreateFile(str(status), win32con.GENERIC_READ, 0, None, win32con.OPEN_EXISTING, 0, None)
timer = Timer(.2, held.Close)
timer.start()
try:
with _open_status_for_read(status) as stream:
assert stream.read() == b'complete correlated status'
finally:
timer.join()