17
17
from jupyter_server .utils import url_path_join
18
18
19
19
20
+ TEST_TIMEOUT = 20
21
+
22
+
20
23
j = lambda r : json .loads (r .body .decode ())
21
24
22
25
@@ -197,6 +200,7 @@ def assert_session_equality(actual, expected):
197
200
assert_kernel_equality (actual ["kernel" ], expected ["kernel" ])
198
201
199
202
203
+ @pytest .mark .timeout (TEST_TIMEOUT )
200
204
async def test_create (session_client , jp_base_url , jp_cleanup_subprocesses , jp_serverapp ):
201
205
# Make sure no sessions exist.
202
206
resp = await session_client .list ()
@@ -241,6 +245,7 @@ async def test_create(session_client, jp_base_url, jp_cleanup_subprocesses, jp_s
241
245
await jp_cleanup_subprocesses ()
242
246
243
247
248
+ @pytest .mark .timeout (TEST_TIMEOUT )
244
249
async def test_create_bad (
245
250
session_client , jp_base_url , jp_cleanup_subprocesses , jp_serverapp , jp_kernelspecs
246
251
):
@@ -261,6 +266,7 @@ async def test_create_bad(
261
266
await jp_cleanup_subprocesses ()
262
267
263
268
269
+ @pytest .mark .timeout (TEST_TIMEOUT )
264
270
async def test_create_bad_pending (
265
271
session_client , jp_base_url , jp_ws_fetch , jp_cleanup_subprocesses , jp_serverapp , jp_kernelspecs
266
272
):
@@ -293,6 +299,7 @@ async def test_create_bad_pending(
293
299
await jp_cleanup_subprocesses ()
294
300
295
301
302
+ @pytest .mark .timeout (TEST_TIMEOUT )
296
303
async def test_create_file_session (
297
304
session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
298
305
):
@@ -306,6 +313,7 @@ async def test_create_file_session(
306
313
await jp_cleanup_subprocesses ()
307
314
308
315
316
+ @pytest .mark .timeout (TEST_TIMEOUT )
309
317
async def test_create_console_session (
310
318
session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
311
319
):
@@ -320,6 +328,7 @@ async def test_create_console_session(
320
328
await jp_cleanup_subprocesses ()
321
329
322
330
331
+ @pytest .mark .timeout (TEST_TIMEOUT )
323
332
async def test_create_deprecated (session_client , jp_cleanup_subprocesses , jp_serverapp ):
324
333
resp = await session_client .create_deprecated ("foo/nb1.ipynb" )
325
334
assert resp .code == 201
@@ -332,6 +341,7 @@ async def test_create_deprecated(session_client, jp_cleanup_subprocesses, jp_ser
332
341
await jp_cleanup_subprocesses ()
333
342
334
343
344
+ @pytest .mark .timeout (TEST_TIMEOUT )
335
345
async def test_create_with_kernel_id (
336
346
session_client , jp_fetch , jp_base_url , jp_cleanup_subprocesses , jp_serverapp
337
347
):
@@ -363,6 +373,7 @@ async def test_create_with_kernel_id(
363
373
await jp_cleanup_subprocesses ()
364
374
365
375
376
+ @pytest .mark .timeout (TEST_TIMEOUT )
366
377
async def test_create_with_bad_kernel_id (
367
378
session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
368
379
):
@@ -378,6 +389,7 @@ async def test_create_with_bad_kernel_id(
378
389
await jp_cleanup_subprocesses ()
379
390
380
391
392
+ @pytest .mark .timeout (TEST_TIMEOUT )
381
393
async def test_delete (session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready ):
382
394
resp = await session_client .create ("foo/nb1.ipynb" )
383
395
@@ -399,6 +411,7 @@ async def test_delete(session_client, jp_cleanup_subprocesses, jp_serverapp, ses
399
411
await jp_cleanup_subprocesses ()
400
412
401
413
414
+ @pytest .mark .timeout (TEST_TIMEOUT )
402
415
async def test_modify_path (session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready ):
403
416
resp = await session_client .create ("foo/nb1.ipynb" )
404
417
newsession = j (resp )
@@ -413,6 +426,7 @@ async def test_modify_path(session_client, jp_cleanup_subprocesses, jp_serverapp
413
426
await jp_cleanup_subprocesses ()
414
427
415
428
429
+ @pytest .mark .timeout (TEST_TIMEOUT )
416
430
async def test_modify_path_deprecated (
417
431
session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
418
432
):
@@ -429,6 +443,7 @@ async def test_modify_path_deprecated(
429
443
await jp_cleanup_subprocesses ()
430
444
431
445
446
+ @pytest .mark .timeout (TEST_TIMEOUT )
432
447
async def test_modify_type (session_client , jp_cleanup_subprocesses , jp_serverapp , session_is_ready ):
433
448
resp = await session_client .create ("foo/nb1.ipynb" )
434
449
newsession = j (resp )
@@ -443,6 +458,7 @@ async def test_modify_type(session_client, jp_cleanup_subprocesses, jp_serverapp
443
458
await jp_cleanup_subprocesses ()
444
459
445
460
461
+ @pytest .mark .timeout (TEST_TIMEOUT )
446
462
async def test_modify_kernel_name (
447
463
session_client , jp_fetch , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
448
464
):
@@ -470,6 +486,7 @@ async def test_modify_kernel_name(
470
486
await jp_cleanup_subprocesses ()
471
487
472
488
489
+ @pytest .mark .timeout (TEST_TIMEOUT )
473
490
async def test_modify_kernel_id (
474
491
session_client , jp_fetch , jp_cleanup_subprocesses , jp_serverapp , session_is_ready
475
492
):
@@ -504,6 +521,7 @@ async def test_modify_kernel_id(
504
521
await jp_cleanup_subprocesses ()
505
522
506
523
524
+ @pytest .mark .timeout (TEST_TIMEOUT )
507
525
async def test_restart_kernel (
508
526
session_client , jp_base_url , jp_fetch , jp_ws_fetch , jp_cleanup_subprocesses , session_is_ready
509
527
):
0 commit comments