Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Jan 24, 2025
1 parent 0d5384d commit f6baeed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,6 @@ def test_connect_options(page):
server_process = subprocess.Popen(
["playwright", "run-server", "--port=1234"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
while True:
stdout = server_process.stdout
Expand All @@ -1022,5 +1021,10 @@ def test_connect_options(page):
result.assert_outcomes(passed=1)
finally:
assert server_process
os.kill(server_process.pid, signal.SIGINT)
# TODO: Playwright CLI on Windows via Python does not forward the signal
# hence we need to send it to the whole process group.
if sys.platform == "win32":
subprocess.run(["taskkill", "/F", "/T", "/PID", str(server_process.pid)])
else:
os.kill(server_process.pid, signal.SIGINT)
server_process.wait()

0 comments on commit f6baeed

Please sign in to comment.