Skip to content

Commit 8ecf5f0

Browse files
authored
Actually use snapshots in nightly step that says so (#1403)
* actually use snapshots in nightly step that says so * correctly terminate proxay and its subprocesses * format * avoid terminating python along with proxay * fix logging * attempt to make splitting order deterministic * change splitting algorithm * store all test durations * no test groups in nightly * cleanup * no new session on windows
1 parent 0881e93 commit 8ecf5f0

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

.github/workflows/nightly.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
max-parallel: 4
1313
matrix:
1414
python-version: ["3.10", "3.11", "3.12", "3.13"]
15-
group: [1, 2, 3]
1615
fail-fast: false
1716
defaults:
1817
run:
@@ -38,12 +37,12 @@ jobs:
3837
- name: Python tests, refreshing the network snapshots
3938
env:
4039
WK_TOKEN: ${{ secrets.WK_TOKEN }}
41-
run: uv run test.py --refresh-snapshots --splits 3 --group ${{ matrix.group }}
40+
run: uv run test.py --refresh-snapshots
4241

4342
- name: Python tests, using the new snapshots
4443
env:
4544
WK_TOKEN: ${{ secrets.WK_TOKEN }}
46-
run: uv run test.py --refresh-snapshots --splits 3 --group ${{ matrix.group }}
45+
run: uv run test.py
4746

4847
- uses: slackapi/[email protected]
4948
if: failure() || cancelled()

webknossos/test.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,30 @@ def proxay(mode: Literal["record", "replay"], quiet: bool) -> Iterator[None]:
199199
)
200200
else:
201201
proxay_process = subprocess.Popen(
202-
cmd,
203-
shell=IS_WINDOWS,
202+
cmd, shell=IS_WINDOWS, start_new_session=(not IS_WINDOWS)
204203
)
205204
sleep(1)
206205
yield
207206
finally:
208207
if proxay_process is not None:
209-
print("Terminating proxay", flush=True)
210-
proxay_process.terminate()
211-
proxay_process.wait(5)
212-
proxay_process.kill()
208+
if IS_WINDOWS:
209+
print("Terminating proxay...")
210+
proxay_process.terminate()
211+
else:
212+
print(
213+
"Terminating proxay and its subprocesses with killpg (SIGTERM)...",
214+
flush=True,
215+
)
216+
pgid = os.getpgid(proxay_process.pid)
217+
try:
218+
os.killpg(pgid, signal.SIGTERM)
219+
proxay_process.wait(timeout=5)
220+
except subprocess.TimeoutExpired:
221+
print(
222+
"Terminating proxay and its subprocesses with killpg (SIGKILL)...",
223+
flush=True,
224+
)
225+
os.killpg(pgid, signal.SIGKILL)
213226

214227

215228
def run_pytest(args: list[str]) -> None:

0 commit comments

Comments
 (0)