|
19 | 19 |
|
20 | 20 |
|
21 | 21 | @pytest.mark.parametrize( |
22 | | - ("case_name", "lazyudf_kwargs"), |
| 22 | + ("case_name", "lazyudf_kwargs", "cleanup_mode"), |
23 | 23 | [ |
24 | | - ("default_jit_policy", ""), |
25 | | - ("jit_false", ", jit=False"), |
26 | | - ("jit_true", ", jit=True"), |
| 24 | + ("original_no_cleanup", "", "none"), |
| 25 | + ("default_jit_policy_with_cleanup", "", "explicit"), |
| 26 | + ("jit_false_no_cleanup", ", jit=False", "none"), |
| 27 | + ("jit_true_no_cleanup", ", jit=True", "none"), |
27 | 28 | ], |
28 | 29 | ) |
29 | | -def test_windows_dsl_scalar_only_flat_idx_shutdown_repro(case_name, lazyudf_kwargs): |
| 30 | +def test_windows_dsl_scalar_only_flat_idx_shutdown_repro(case_name, lazyudf_kwargs, cleanup_mode): |
30 | 31 | """Exercise the suspected crash path in a child process. |
31 | 32 |
|
32 | 33 | The child prints milestones with flush=True. If Windows returns |
@@ -78,18 +79,23 @@ def kernel(start, stop, nitems): |
78 | 79 | np.testing.assert_allclose(arr, exp, rtol=1e-6, atol=1e-6) |
79 | 80 | print("assert-ok", flush=True) |
80 | 81 |
|
81 | | - del exp |
82 | | - print("del-exp", flush=True) |
83 | | - gc.collect() |
84 | | - print("gc-after-exp", flush=True) |
85 | | - del arr |
86 | | - print("del-arr", flush=True) |
87 | | - gc.collect() |
88 | | - print("gc-after-arr", flush=True) |
89 | | - del expr |
90 | | - print("del-expr", flush=True) |
91 | | - gc.collect() |
92 | | - print("gc-after-expr", flush=True) |
| 82 | + cleanup_mode = {cleanup_mode!r} |
| 83 | + print("cleanup-mode=" + cleanup_mode, flush=True) |
| 84 | + if cleanup_mode == "explicit": |
| 85 | + del exp |
| 86 | + print("del-exp", flush=True) |
| 87 | + gc.collect() |
| 88 | + print("gc-after-exp", flush=True) |
| 89 | + del arr |
| 90 | + print("del-arr", flush=True) |
| 91 | + gc.collect() |
| 92 | + print("gc-after-arr", flush=True) |
| 93 | + del expr |
| 94 | + print("del-expr", flush=True) |
| 95 | + gc.collect() |
| 96 | + print("gc-after-expr", flush=True) |
| 97 | + else: |
| 98 | + print("leaving-arr-expr-live-for-interpreter-shutdown", flush=True) |
93 | 99 | print("script-end", flush=True) |
94 | 100 | """ |
95 | 101 | ) |
|
0 commit comments