projects
/
lsp-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6ec0dc6
)
Tweak timeout tests
travis-windows
author
Luke Lau
<luke_lau@icloud.com>
Fri, 7 Dec 2018 20:45:24 +0000
(20:45 +0000)
committer
Luke Lau
<luke_lau@icloud.com>
Fri, 7 Dec 2018 20:45:24 +0000
(20:45 +0000)
test/Test.hs
patch
|
blob
|
history
diff --git
a/test/Test.hs
b/test/Test.hs
index 36fc0aaef2fa5b43348d612ad7c344b18a4b6443..d4c1529ed7ac1ea2af30c7686d2c623d2a62b672 100644
(file)
--- a/
test/Test.hs
+++ b/
test/Test.hs
@@
-52,19
+52,20
@@
main = hspec $ do
withTimeout 5 $ skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest
-- wait just a bit longer than 5 seconds so we have time
-- to open the document
withTimeout 5 $ skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest
-- wait just a bit longer than 5 seconds so we have time
-- to open the document
- in timeout 6
000000
sesh `shouldThrow` anySessionException
+ in timeout 6
e6
sesh `shouldThrow` anySessionException
it "doesn't time out" $
let sesh = runSession "hie" fullCaps "test/data/renamePass" $ do
openDoc "Desktop/simple.hs" "haskell"
withTimeout 5 $ skipManyTill anyMessage publishDiagnosticsNotification
it "doesn't time out" $
let sesh = runSession "hie" fullCaps "test/data/renamePass" $ do
openDoc "Desktop/simple.hs" "haskell"
withTimeout 5 $ skipManyTill anyMessage publishDiagnosticsNotification
- in void $ timeout 6
000000
sesh
+ in void $ timeout 6
e6
sesh
it "further timeout messages are ignored" $ runSessionWithConfig (defaultConfig { logStdErr = True, logMessages = True }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
it "further timeout messages are ignored" $ runSessionWithConfig (defaultConfig { logStdErr = True, logMessages = True }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
+ getDocumentSymbols doc
withTimeout 3 $ getDocumentSymbols doc
withTimeout 3 $ getDocumentSymbols doc
- liftIO $ threadDelay 5000000
-- shouldn't throw an exception
-- shouldn't throw an exception
+ liftIO $ threadDelay 5e6
getDocumentSymbols doc
return ()
getDocumentSymbols doc
return ()
@@
-73,7
+74,7
@@
main = hspec $ do
runSessionWithConfig (def { messageTimeout = 5 }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
-- shouldn't time out in here since we are overriding it
runSessionWithConfig (def { messageTimeout = 5 }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
-- shouldn't time out in here since we are overriding it
- withTimeout 10 $ liftIO $ threadDelay 7
000000
+ withTimeout 10 $ liftIO $ threadDelay 7
e6
getDocumentSymbols doc
return True
in sesh `shouldReturn` True
getDocumentSymbols doc
return True
in sesh `shouldReturn` True
@@
-83,7
+84,7
@@
main = hspec $ do
runSessionWithConfig (def { messageTimeout = 5 }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
-- shouldn't time out in here since we are overriding it
runSessionWithConfig (def { messageTimeout = 5 }) "hie" fullCaps "test/data/renamePass" $ do
doc <- openDoc "Desktop/simple.hs" "haskell"
-- shouldn't time out in here since we are overriding it
- withTimeout 10 $ liftIO $ threadDelay 7
000000
+ withTimeout 10 $ liftIO $ threadDelay 7
e6
getDocumentSymbols doc
-- should now timeout
skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest
getDocumentSymbols doc
-- should now timeout
skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest