diff --git a/runtime/tests/dev1/entry_flow_touch_test.gd b/runtime/tests/dev1/entry_flow_touch_test.gd index 00a47de7..99fb8ace 100644 --- a/runtime/tests/dev1/entry_flow_touch_test.gd +++ b/runtime/tests/dev1/entry_flow_touch_test.gd @@ -18,6 +18,7 @@ func run_test() -> void: root.size = Vector2i(1280, 720) _cleanup() var game = MainScene.instantiate() + game.audio_enabled = false root.add_child(game) await _frames(50) var shell = game.entry_shell @@ -39,24 +40,23 @@ func run_test() -> void: var back: Button = shell.find_child("SettingsBack", true, false) await _touch(back) expect(shell.current_screen == "title" and shell.settings.locale == "en", "locale applies and Back returns to Title") - game.queue_free() - await _frames(20) + await _release_scene(game) var restarted = MainScene.instantiate() + restarted.audio_enabled = false root.add_child(restarted) await _frames(50) var restarted_title := await _wait_for_node(restarted.entry_shell, "TitleSafeArea") expect(restarted_title != null and restarted.entry_shell.current_screen == "title", "restart skips completed first launch") - restarted.queue_free() - await _frames(20) + await _release_scene(restarted) _cleanup() var reset_game = MainScene.instantiate() + reset_game.audio_enabled = false root.add_child(reset_game) await _frames(50) var reset_setup := await _wait_for_node(reset_game.entry_shell, "FirstLaunchResponsiveLayout") expect(reset_setup != null, "settings reset restores first-launch setup") - reset_game.queue_free() - await _frames(20) + await _release_scene(reset_game) _cleanup() if failures.is_empty(): print("ABG_DEV1_ENTRY_TOUCH_OK parsed_screen_touch=true boot_setup_title_settings_apply_back=true restart=title reset=first_launch") @@ -67,6 +67,18 @@ func run_test() -> void: quit(1) +func _release_scene(scene: Node) -> void: + # Release the synthesized SFX stream while the tree is still alive; freeing + # it during teardown races the audio server and leaks the generator playback. + var facade = scene.get("facade") + if facade != null: + var adapter = facade.get("audio_adapter") + if adapter != null: + adapter.cleanup() + scene.queue_free() + await _frames(20) + + func _touch(control: Control) -> void: var center := root.get_final_transform() * control.get_global_rect().get_center() var press := InputEventScreenTouch.new() diff --git a/runtime/tests/dev2/initial_company_full_flow_touch_test.gd b/runtime/tests/dev2/initial_company_full_flow_touch_test.gd index fb4a5665..a68aabfc 100644 --- a/runtime/tests/dev2/initial_company_full_flow_touch_test.gd +++ b/runtime/tests/dev2/initial_company_full_flow_touch_test.gd @@ -23,6 +23,7 @@ func run_test() -> void: _cleanup() var game = MainScene.instantiate() + game.audio_enabled = false root.add_child(game) await _frames(60) var shell = game.entry_shell @@ -44,6 +45,7 @@ func run_test() -> void: await _frames(20) var precommit_restart = MainScene.instantiate() + precommit_restart.audio_enabled = false root.add_child(precommit_restart) await _frames(60) var restarted_shell = precommit_restart.entry_shell @@ -60,6 +62,7 @@ func run_test() -> void: await _frames(20) var committed_restart = MainScene.instantiate() + committed_restart.audio_enabled = false root.add_child(committed_restart) await _frames(60) var committed_roster := await _wait_for_node(committed_restart.entry_shell, "GuildRoster")