diff --git a/reflex-dom-core/test/hydration.hs b/reflex-dom-core/test/hydration.hs index 16269a73..2e193f3f 100644 --- a/reflex-dom-core/test/hydration.hs +++ b/reflex-dom-core/test/hydration.hs @@ -89,9 +89,6 @@ import qualified Test.WebDriver.Capabilities as WD import Test.Util.ChromeFlags import Test.Util.UnshareNetwork --- ORPHAN: https://github.com/kallisti-dev/hs-webdriver/pull/167 -deriving instance MonadMask WD - chromium :: FilePath chromium = $(staticWhich "chromium") @@ -717,6 +714,8 @@ tests withDebugging wdConfig caps _selenium = do inputRef <- newRef ("" :: Text) let checkValue = do WD.sendKeys "hello world" =<< findElemWithRetry (WD.ByTag "textarea") + -- This delay is for fixing spurious CI failures + liftIO $ threadDelay (4000 * 1000) WD.click =<< findElemWithRetry (WD.ByTag "button") readRef inputRef `shouldBeWithRetryM` "hello world" testWidget (pure ()) checkValue $ do @@ -919,6 +918,8 @@ tests withDebugging wdConfig caps _selenium = do e <- findElemWithRetry $ WD.ByTag "select" assertAttr e "value" (Just "one") WD.click =<< findElemWithRetry (WD.ById "two") + -- This delay is for fixing spurious CI failures + liftIO $ threadDelay (4000 * 1000) assertAttr e "value" (Just "two") WD.click =<< findElemWithRetry (WD.ByTag "button") readRef inputRef `shouldBeWithRetryM` "two" @@ -991,7 +992,10 @@ tests withDebugging wdConfig caps _selenium = do performEvent_ $ liftIO . writeRef focusRef <$> updated (_selectElement_hasFocus e) it "has correct initial value" $ runWD $ do valueRef :: IORef Text <- newRef "" - let checkValue = readRef valueRef `shouldBeWithRetryM` "one" + let checkValue = do + -- This is a no-op, but prevents a deadlock situation + _ <- findElemWithRetry $ WD.ByTag "body" + readRef valueRef `shouldBeWithRetryM` "one" testWidget (pure ()) checkValue $ do prerender_ (pure ()) $ do (e, ()) <- selectElement def { _selectElementConfig_initialValue = "one" } options @@ -1163,6 +1167,8 @@ tests withDebugging wdConfig caps _selenium = do liftIO $ do writeChan replaceChan1 "one" takeMVar lock + -- This delay is for fixing spurious CI failures + threadDelay (1000 * 1000) one <- findElemWithRetry $ WD.ByTag "div" shouldContainText "pb" one liftIO $ writeChan replaceChan2 "two"