Skip to content

Commit 2e145cc

Browse files
committed
kill as root
1 parent b9eedf0 commit 2e145cc

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

js/tests/supervisord.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +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 by pid
23-
await sandbox.commands.run(
24-
"kill -9 $(pgrep -f 'jupyter server')"
25-
)
22+
// Kill the jupyter process as root
23+
await sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')", {
24+
user: 'root',
25+
})
2626

2727
// Wait for supervisord to restart it and health to come back
2828
const recovered = await waitForHealth(sandbox, 10, 100)
@@ -38,10 +38,10 @@ sandboxTest('restart after code-interpreter kill', async ({ sandbox }) => {
3838
const initialHealth = await waitForHealth(sandbox)
3939
expect(initialHealth).toBe(true)
4040

41-
// Kill the code-interpreter process by pid
42-
await sandbox.commands.run(
43-
'kill -9 $(cat /var/run/code-interpreter.pid)'
44-
)
41+
// Kill the code-interpreter process as root
42+
await sandbox.commands.run('kill -9 $(cat /var/run/code-interpreter.pid)', {
43+
user: 'root',
44+
})
4545

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

python/tests/async/test_async_supervisord.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def test_restart_after_jupyter_kill(async_sandbox: AsyncSandbox):
1919
assert await wait_for_health(async_sandbox)
2020

2121
# Kill the jupyter process by pid
22-
await async_sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')")
22+
await async_sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')", user="root")
2323

2424
# Wait for supervisord to restart it and health to come back
2525
assert await wait_for_health(async_sandbox, 10, 100)
@@ -34,7 +34,7 @@ async def test_restart_after_code_interpreter_kill(async_sandbox: AsyncSandbox):
3434
assert await wait_for_health(async_sandbox)
3535

3636
# Kill the code-interpreter process by pid
37-
await async_sandbox.commands.run("kill -9 $(cat /var/run/code-interpreter.pid)")
37+
await async_sandbox.commands.run("kill -9 $(cat /var/run/code-interpreter.pid)", user="root")
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: 6 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 by pid
22-
sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')")
21+
# Kill the jupyter process as root
22+
sandbox.commands.run("kill -9 $(pgrep -f 'jupyter server')", user="root")
2323

2424
# Wait for supervisord to restart it and health to come back
2525
assert wait_for_health(sandbox, 10, 100)
@@ -33,8 +33,10 @@ 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 by pid
37-
sandbox.commands.run("kill -9 $(cat /var/run/code-interpreter.pid)")
36+
# Kill the code-interpreter process as root
37+
sandbox.commands.run(
38+
"kill -9 $(cat /var/run/code-interpreter.pid)", user="root"
39+
)
3840

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

0 commit comments

Comments
 (0)