Skip to content

Commit b9eedf0

Browse files
committed
update tests
1 parent dd60d00 commit b9eedf0

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

js/tests/supervisord.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ sandboxTest('restart after jupyter kill', async ({ sandbox }) => {
1919
const initialHealth = await waitForHealth(sandbox)
2020
expect(initialHealth).toBe(true)
2121

22-
// Kill the jupyter process
23-
await sandbox.commands.run('supervisorctl stop jupyter')
22+
// Kill the jupyter process by pid
23+
await sandbox.commands.run(
24+
"kill -9 $(pgrep -f 'jupyter server')"
25+
)
2426

2527
// Wait for supervisord to restart it and health to come back
2628
const recovered = await waitForHealth(sandbox, 10, 100)
@@ -36,8 +38,10 @@ sandboxTest('restart after code-interpreter kill', async ({ sandbox }) => {
3638
const initialHealth = await waitForHealth(sandbox)
3739
expect(initialHealth).toBe(true)
3840

39-
// Kill the code-interpreter process
40-
await sandbox.commands.run('supervisorctl stop code-interpreter')
41+
// Kill the code-interpreter process by pid
42+
await sandbox.commands.run(
43+
'kill -9 $(cat /var/run/code-interpreter.pid)'
44+
)
4145

4246
// Wait for supervisord to restart it and health to come back
4347
const recovered = await waitForHealth(sandbox, 10, 100)

python/tests/async/test_async_supervisord.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ async def test_restart_after_jupyter_kill(async_sandbox: AsyncSandbox):
1818
# Verify health is up initially
1919
assert await wait_for_health(async_sandbox)
2020

21-
# Kill the jupyter process
22-
await async_sandbox.commands.run("supervisorctl stop jupyter")
21+
# Kill the jupyter process by pid
22+
await async_sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')")
2323

2424
# Wait for supervisord to restart it and health to come back
2525
assert await wait_for_health(async_sandbox, 10, 100)
@@ -33,8 +33,8 @@ async def test_restart_after_code_interpreter_kill(async_sandbox: AsyncSandbox):
3333
# Verify health is up initially
3434
assert await wait_for_health(async_sandbox)
3535

36-
# Kill the code-interpreter process
37-
await async_sandbox.commands.run("supervisorctl stop code-interpreter")
36+
# Kill the code-interpreter process by pid
37+
await async_sandbox.commands.run("kill -9 $(cat /var/run/code-interpreter.pid)")
3838

3939
# Wait for supervisord to restart it and health to come back
4040
assert await wait_for_health(async_sandbox, 10, 100)

python/tests/sync/test_supervisord.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def test_restart_after_jupyter_kill(sandbox: Sandbox):
1818
# Verify health is up initially
1919
assert wait_for_health(sandbox)
2020

21-
# Kill the jupyter process
22-
sandbox.commands.run("supervisorctl stop jupyter")
21+
# Kill the jupyter process by pid
22+
sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')")
2323

2424
# Wait for supervisord to restart it and health to come back
2525
assert wait_for_health(sandbox, 10, 100)
@@ -33,8 +33,8 @@ def test_restart_after_code_interpreter_kill(sandbox: Sandbox):
3333
# Verify health is up initially
3434
assert wait_for_health(sandbox)
3535

36-
# Kill the code-interpreter process
37-
sandbox.commands.run("supervisorctl stop code-interpreter")
36+
# Kill the code-interpreter process by pid
37+
sandbox.commands.run("kill -9 $(cat /var/run/code-interpreter.pid)")
3838

3939
# Wait for supervisord to restart it and health to come back
4040
assert wait_for_health(sandbox, 10, 100)

0 commit comments

Comments
 (0)