fix(game-env): the audio-stream probe checks the game is still running before each sample

This commit is contained in:
The412Banner committed 2026-11-21 02:31:28 +00:00
1 parent acbd6ac688
commit 2bd7d96642
2 files changed
+12

No files matched your search

@@ -1278,6 +1278,7 @@ AUDIO_STREAMS_PROBE = (
'folder=$1; launch=$2; shift 2; n=0; '
'for t in "$@"; do '
'while [ "$n" -lt "$t" ]; do kill -0 "$launch" 2>/dev/null || exit 0; sleep 1; n=$((n + 1)); done; '
'kill -0 "$launch" 2>/dev/null || exit 0; '
'{ echo "== $(date +%T)"; pactl list sink-inputs 2>&1 | head -80; } >> "$folder/audio-streams.txt"; '
'done'
)
+11
View File
@@ -2038,6 +2038,17 @@ class GameEnvironmentTest(unittest.TestCase):
subprocess.run(probe + [tmp, str(ended.pid), "20", "60"], timeout=10, check=True)
self.assertEqual(samples(tmp), 0)
with tempfile.TemporaryDirectory() as tmp:
game = subprocess.Popen(["sleep", "0.5"])
running = subprocess.Popen(probe + [tmp, str(game.pid), "1"])
try:
game.wait()
self.assertEqual(running.wait(timeout=10), 0)
self.assertEqual(samples(tmp), 0)
finally:
running.kill()
running.wait()
def test_open_driver_pairs_report_the_drivers_own_vkd3d_caps(self):
apply = MODULE["apply_config"]
config = {"version": 1, "shared": {"VKD3D_FEATURE_LEVEL": "12_2", "VKD3D_SHADER_MODEL": "6_9"},