From cbf371978c8fe835419233a98430c36abef26c77 Mon Sep 17 00:00:00 2001 From: Divam Date: Wed, 14 Jun 2023 12:18:50 +0900 Subject: [PATCH 1/2] Remove MonadMask instance, its now available from upstream --- reflex-dom-core/test/hydration.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/reflex-dom-core/test/hydration.hs b/reflex-dom-core/test/hydration.hs index 16269a73..7ca00594 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") From c575d8fbec2df4fcac23b2b007ebf7092e6d3b1f Mon Sep 17 00:00:00 2001 From: Divam Date: Thu, 15 Jun 2023 11:50:31 +0900 Subject: [PATCH 2/2] Add threadDelay(s), etc to prevent spurious CI failures --- reflex-dom-core/test/hydration.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reflex-dom-core/test/hydration.hs b/reflex-dom-core/test/hydration.hs index 7ca00594..2e193f3f 100644 --- a/reflex-dom-core/test/hydration.hs +++ b/reflex-dom-core/test/hydration.hs @@ -714,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 @@ -916,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" @@ -988,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 @@ -1160,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"