Skip to content

Commit 253cd19

Browse files
committed
Obviously interruption python doesn't work in single threaded RTS
1 parent 06ae018 commit 253cd19

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎test/TST/Run.hs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ tests = testGroup "Run python"
4444
$ do liftIO $ putMVar lock ()
4545
liftIO $ threadDelay 10_000_000
4646
error "Should be interrupted"
47-
, testCase "Exception in runPyInMain works py" $ do
48-
lock <- newEmptyMVar
49-
tid <- myThreadId
50-
_ <- forkIO $ takeMVar lock >> threadDelay 1000 >> throwTo tid Stop
51-
handle (\Stop -> pure ())
52-
$ runPyInMain
53-
$ do liftIO $ putMVar lock ()
54-
[py_|
55-
import time
56-
while True:
57-
time.sleep(1e-3)
58-
|]
59-
error "Should be interrupted"
6047
, testCase "Scope pymain->any" $ runPy $ do
6148
[pymain|
6249
x = 12
@@ -225,6 +212,19 @@ tests = testGroup "Run python"
225212
True -> error "Timeout"
226213
False -> retry
227214
return ()
215+
, testCase "Exception in runPyInMain works py" $ do
216+
lock <- newEmptyMVar
217+
tid <- myThreadId
218+
_ <- forkIO $ takeMVar lock >> threadDelay 1000 >> throwTo tid Stop
219+
handle (\Stop -> pure ())
220+
$ runPyInMain
221+
$ do liftIO $ putMVar lock ()
222+
[py_|
223+
import time
224+
while True:
225+
time.sleep(1e-3)
226+
|]
227+
error "Should be interrupted"
228228
]
229229
]
230230

0 commit comments

Comments
 (0)