Give each fixture run in a test its own spawner socket

This commit is contained in:
Kurt Himebauch committed 2026-12-04 17:43:20 -05:00
1 parent 3211c91e30
commit 9e2e0215fa
1 file changed
+5 -2
+5 -2
View File
@@ -1587,6 +1587,9 @@ class NativeHookHandoffTest(unittest.TestCase):
def run_parent(self, *argv, handoff="target", hook=True, reports=True, pressure=None, as_shell=False, terminal=False,
delay=0, extra_env=None, parent_name=None):
name = "dd-handoff-test-%d-%s-%s-%d" % (os.getpid(), self.id().rsplit(".", 1)[-1], handoff, hook)
self.runs = getattr(self, "runs", 0) + 1 # subtests run the fixture again under the same test id
if self.runs > 1:
name += "-%d" % self.runs
spawner = FakeSpawner(name, self.prefix or [], self.root, reports, delay)
spawner.start()
self.addCleanup(spawner.sock.close)
@@ -1920,7 +1923,7 @@ class NativeHookHandoffTest(unittest.TestCase):
self.assertEqual(1, len(requests), out.stderr)
self.assertEqual(["wine", "/opt/wine/bin/wine", command_line, "7"], requests[0]["argv"])
def test_a_windows_program_from_outside_c_windows_is_not_handed_off(self):
def test_a_game_under_wine_is_not_handed_off(self):
# a game: Android would sample its memory as an app process's own
for command_line in ("LikeADragonPirates.exe", "S:\\steamapps\\common\\Game\\startup.exe",
".\\crashreport\\crashpad_handler.exe", "C:\\windowsapps\\game.exe"):
@@ -1929,7 +1932,7 @@ class NativeHookHandoffTest(unittest.TestCase):
self.assertEqual([], requests, out.stderr)
self.assertEqual("1", result.get("same"), out.stdout)
def test_near_the_limit_a_windows_program_from_outside_c_windows_is_not_handed_off(self):
def test_near_the_limit_a_game_under_wine_is_not_handed_off(self):
result, requests, out = self.run_wine("LikeADragonPirates.exe", pressure=0, as_shell=True)
self.assertEqual([], requests, out.stderr)