fix: preserve GPUI lifetime and avoid WASAPI silence warnings
This commit is contained in:
@@ -81,6 +81,34 @@ swaymsg '[app_id="dev.clipbin.Clipbin"] kill' >/dev/null
|
||||
wait_windows 0
|
||||
menu 1
|
||||
wait_windows 1
|
||||
# Repeated reopen must release each UI's threads and allocation state.
|
||||
measure() {
|
||||
python3 - "${app}" "$1" <<'PYMETRICS'
|
||||
import pathlib,sys
|
||||
status=dict(line.split(':',1) for line in pathlib.Path(f'/proc/{sys.argv[1]}/status').read_text().splitlines() if ':' in line)
|
||||
print(f"{sys.argv[2]}\t{status['Threads'].strip()}\t{status['VmRSS'].split()[0]}")
|
||||
PYMETRICS
|
||||
}
|
||||
measure 0 > "${out}/reopen-metrics.tsv"
|
||||
for cycle in $(seq 5); do
|
||||
swaymsg '[app_id="dev.clipbin.Clipbin"] kill' >/dev/null
|
||||
wait_windows 0
|
||||
sleep 1
|
||||
menu 1
|
||||
wait_windows 1
|
||||
sleep 1
|
||||
measure "${cycle}" >> "${out}/reopen-metrics.tsv"
|
||||
done
|
||||
cat "${out}/reopen-metrics.tsv"
|
||||
python3 - "${out}/reopen-metrics.tsv" <<'PYBOUNDS'
|
||||
import pathlib,sys
|
||||
rows=[tuple(map(int,line.split())) for line in pathlib.Path(sys.argv[1]).read_text().splitlines()]
|
||||
assert max(r[1] for r in rows[1:]) <= rows[0][1]+4, rows
|
||||
# Allow the first reopen to warm caches; later windows must stay bounded.
|
||||
rss=[r[2] for r in rows[1:]]
|
||||
assert max(rss)-min(rss) <= 32*1024 and rows[-1][2] <= rows[0][2]+64*1024, rows
|
||||
print('PASS five close/reopen cycles have bounded thread count and RSS')
|
||||
PYBOUNDS
|
||||
# Audio delivery loss must be visible in the application and real tray tooltip.
|
||||
kill "$(cat "${CLIPBIN_RIG_DIR}/pulse.pid")"
|
||||
for _ in $(seq 15); do grep -q 'recorder_status=Degraded' "${out}/desktop.log" && break; sleep 1; done
|
||||
|
||||
Reference in New Issue
Block a user