Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit d833fab

Browse files
committed
Avoid timing sensitivity in test
1 parent d59d444 commit d833fab

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

test/DispatcherSpec.hs

+8-10
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,14 @@ dispatcherSpec = do
232232
r2 <- withStdoutLogging $ runIdeM (IdeState Map.empty) (doDispatch (testPlugins chSync) cr2)
233233
r1 `shouldBe` Nothing
234234
r2 `shouldBe` Nothing
235-
yield
236-
rc1 <- atomically $ tryReadTChan chan
237-
yield
238-
rc2 <- atomically $ tryReadTChan chan
239-
rc1 `shouldBe` Just (CResp { couPlugin = "test"
240-
, coutReqId = 2
241-
, coutResp = IdeResponseOk (HM.fromList [("response",String "asyncCmd2 sent strobe")])})
242-
rc2 `shouldBe` Just (CResp { couPlugin = "test"
243-
, coutReqId = 1
244-
, coutResp = IdeResponseOk (HM.fromList [("response",String "asyncCmd1 got strobe")])})
235+
rc1 <- atomically $ readTChan chan
236+
rc2 <- atomically $ readTChan chan
237+
rc1 `shouldBe` (CResp { couPlugin = "test"
238+
, coutReqId = 2
239+
, coutResp = IdeResponseOk (HM.fromList [("response",String "asyncCmd2 sent strobe")])})
240+
rc2 `shouldBe` (CResp { couPlugin = "test"
241+
, coutReqId = 1
242+
, coutResp = IdeResponseOk (HM.fromList [("response",String "asyncCmd1 got strobe")])})
245243

246244
-- ---------------------------------------------------------------------
247245

0 commit comments

Comments
 (0)