You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] bats-core load.bats/tagging.bats hang inside bats' own harness machinery (gather-phase DEBUG-trace evaluation / nested run-capture) #283
wt6/shell2 finding: after the array-subscript + [[ BANG fixes (landed in 2c126128), filter.bats is full parity but load/tagging hang in bats' own machinery — timeout-bounded evidence in target/issue-suites/results/wt6-shell2/. Also platform-invalid .bats/run-logs/.log on Windows (env-bound, documented workaround).
wt7/resid2 lane findings (bats-core @52439eb, rubash-as-bash via a bash.exe copy first on PATH):
The load.bats/tagging.bats "hang" is not a deadlock — it is a throughput wall in bats' own gather machinery:
Single-test repro: timeout -k 5 170 ./bin/bats -f 'no load path' test/load.batscompletes in ~63 s and PASSES (ok 1 find_in_bats_lib_path returns 1 if no load path is found, rc=0). The 25-90 s harness budgets kill it mid-gather, which presented as a hang.
Instrumented bats-gather-tests (xtrace to a side log) shows the gather progressing linearly (~21k trace lines / 8 s, no repetition loop). Cost driver: bats_debug_trap fires for EVERY simple command while evaluating the preprocessed .bats and calls bats_normalize_windows_dir_path, whose NORMALIZED_INPUT=$(cd "$path" || exit 1; pwd) forks a command substitution per fire. On rubash a trap+comsub fire costs ~1.8-6 ms vs GNU's ~50 us — bats-core multiplies that by thousands of fires per file, and load.bats additionally spawns a NESTED bats per test (26 full gathers). Net: full load.bats is ~26x60 s, far over any sane harness budget.
LLDB during the stall shows the parent waiting on the child (WaitForSingleObject), matching "slow, not stuck"; no engine spin.
The engine-side lever is comsub/trap throughput (perf round territory), not a semantics fix. filter.bats re-verified on this lane's build: 6/6 ok, rc=0 (full parity retained).
Env-bound (confirmed, platform-invalid):bats-exec-test: line 190 reports Invalid argument when appending to BATS_RUNLOG_FILE under .bats/run-logs/<date-with-colons>.log — the coloned filename cannot exist on NTFS. Tests still pass; only the runlog write fails.
No rubash semantic bug found in bats' nested run-capture for these files; closing criteria for the engine side should be a comsub-throughput budget (e.g. N ms per trap fire) rather than a diff count.
Activity
caomengxuan666 commentedon Sep 28, 2026
wt7/resid2 lane findings (bats-core @52439eb, rubash-as-bash via a bash.exe copy first on PATH):
The load.bats/tagging.bats "hang" is not a deadlock — it is a throughput wall in bats' own gather machinery:
timeout -k 5 170 ./bin/bats -f 'no load path' test/load.batscompletes in ~63 s and PASSES (ok 1 find_in_bats_lib_path returns 1 if no load path is found, rc=0). The 25-90 s harness budgets kill it mid-gather, which presented as a hang.bats-gather-tests(xtrace to a side log) shows the gather progressing linearly (~21k trace lines / 8 s, no repetition loop). Cost driver:bats_debug_trapfires for EVERY simple command while evaluating the preprocessed .bats and callsbats_normalize_windows_dir_path, whoseNORMALIZED_INPUT=$(cd "$path" || exit 1; pwd)forks a command substitution per fire. On rubash a trap+comsub fire costs ~1.8-6 ms vs GNU's ~50 us — bats-core multiplies that by thousands of fires per file, and load.bats additionally spawns a NESTED bats per test (26 full gathers). Net: full load.bats is ~26x60 s, far over any sane harness budget.Env-bound (confirmed, platform-invalid):
bats-exec-test: line 190reportsInvalid argumentwhen appending toBATS_RUNLOG_FILEunder.bats/run-logs/<date-with-colons>.log— the coloned filename cannot exist on NTFS. Tests still pass; only the runlog write fails.No rubash semantic bug found in bats' nested run-capture for these files; closing criteria for the engine side should be a comsub-throughput budget (e.g. N ms per trap fire) rather than a diff count.
resid2 lane: printf family parity, stderr dup2 snapshot, mkdir wrappe…
caomengxuan666 commentedon Sep 28, 2026
根因裁定并文档化(commit ade9e7ce):非语义死锁——bats_debug_trap 每命令跑一次路径规范化 comsub,rubash 单次 2-6ms,170s 预算内单测完成并通过(ok 1 rc0);filter.bats 复验 6/6。性能属 #242 热路径家族;date-with-colons 日志名为平台非法文件名(env-bound,bats-exec-test:190)。予以关闭,性能侧另行跟踪。