File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -5362,13 +5362,23 @@ testIde arguments session = do
5362
5362
config <- getConfigFromEnv
5363
5363
(hInRead, hInWrite) <- createPipe
5364
5364
(hOutRead, hOutWrite) <- createPipe
5365
- let server = IDE. defaultMain arguments
5365
+ server <- async $ IDE. defaultMain arguments
5366
5366
{ IDE. argsHandleIn = pure hInRead
5367
5367
, IDE. argsHandleOut = pure hOutWrite
5368
+ , IDE. argsIdeOptions = \ config sessionLoader ->
5369
+ let ideOptions = (argsIdeOptions def config sessionLoader) {optTesting = IdeTesting True }
5370
+ in ideOptions {optShakeOptions = (optShakeOptions ideOptions) {shakeThreads = 2 }}
5368
5371
}
5369
5372
5370
- withAsync server $ \ _ ->
5371
- runSessionWithHandles hInWrite hOutRead config lspTestCaps " ." session
5373
+ runSessionWithHandles hInWrite hOutRead config lspTestCaps " ." session
5374
+
5375
+ hClose inw
5376
+ timeout 3 (wait server) >>= \ case
5377
+ Just () -> pure ()
5378
+ Nothing -> do
5379
+ putStrLn " Server does not exit in 3s, canceling the async task..."
5380
+ (t, _) <- duration $ cancel server
5381
+ putStrLn $ " Finishing canceling (took " <> showDuration t <> " s)"
5372
5382
5373
5383
positionMappingTests :: TestTree
5374
5384
positionMappingTests =
You can’t perform that action at this time.
0 commit comments