File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33
44import os
55import pathlib
6+ import platform
67import time
78
89import numpy as np
2122)
2223
2324
25+ def platform_is_wsl ():
26+ return platform .system () == "Linux" and "microsoft" in pathlib .Path ("/proc/version" ).read_text ().lower ()
27+
28+
2429def test_event_init_disabled ():
2530 with pytest .raises (RuntimeError , match = r"^Event objects cannot be instantiated directly\." ):
2631 cuda .core .experimental ._event .Event () # Ensure back door is locked.
@@ -40,7 +45,7 @@ def test_timing_success(init_cuda):
4045 # We only want to exercise the __sub__ method, this test is not meant
4146 # to stress-test the CUDA driver or time.sleep().
4247 delay_ms = delay_seconds * 1000
43- if os .name == "nt" : # noqa: SIM108
48+ if os .name == "nt" or platform_is_wsl () : # noqa: SIM108
4449 # For Python <=3.10, the Windows timer resolution is typically limited to 15.6 ms by default.
4550 generous_tolerance = 100
4651 else :
You can’t perform that action at this time.
0 commit comments