-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Description
My tests randomly crash with:
test-binary: Maybe.fromJust: Nothing
CallStack (from HasCallStack):
error, called at libraries/base/Data/Maybe.hs:148:21 in base:Data.Maybe
fromJust, called at src/Language/LSP/Test.hs:327:20 in lsp-test-0.14.0.0-26fxKpgpCT6HDpy4E8JMz7:Language.LSP.Test
### Error in: Unit tests - Dirties generateTargets after file edit
Timed out waiting to receive a message from the server.
Cases: 1 Tried: 1 Errors: 1 Failures: 0
Could this be a concurrency issue? The code doesn't seem thread-safe:
lsp/lsp-test/src/Language/LSP/Test.hs
Lines 318 to 327 in 6b34b5b
| idn <- curReqId <$> get | |
| modify $ \c -> c { curReqId = idn+1 } | |
| let id = IdInt idn | |
| let mess = RequestMessage "2.0" id method params | |
| -- Update the request map | |
| reqMap <- requestMap <$> ask | |
| liftIO $ modifyMVar_ reqMap $ | |
| \r -> return $ fromJust $ updateRequestMap r id method |