Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark LoggingSpec pending on macOS to alleviate timeouts #2709

Merged
merged 2 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/core/test/unit/Network/Wai/Middleware/LoggingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ import Test.QuickCheck
( Arbitrary (..), choose, counterexample, property, withMaxSuccess )
import Test.QuickCheck.Monadic
( assert, monadicIO, monitor )
import Test.Utils.Darwin
( pendingOnMacOS )
import UnliftIO.Async
( Async, async, cancel, mapConcurrently, replicateConcurrently_ )
import UnliftIO.Concurrent
Expand All @@ -113,7 +115,9 @@ import qualified Data.Text as T
import qualified Network.Wai.Handler.Warp as Warp

spec :: Spec
spec = describe "Logging Middleware" $ do
spec = before (pendingOnMacOS "#2472 regular timeouts in macOS hydra builds")
$ describe "Logging Middleware" $ do

before setup $ after tearDown $ do
it "GET, 200, no query" $ \ctx -> do
get ctx "/get"
Expand Down
1 change: 1 addition & 0 deletions lib/test-utils/cardano-wallet-test-utils.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ library
exposed-modules:
Test.Hspec.Extra
Test.QuickCheck.Extra
Test.Utils.Darwin
Test.Utils.FilePath
Test.Utils.Laws
Test.Utils.Laws.PartialOrd
Expand Down
27 changes: 27 additions & 0 deletions lib/test-utils/src/Test/Utils/Darwin.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- |
-- Copyright: © 2018-2021 IOHK
-- License: Apache-2.0
--
-- Utility function for making test suites pass on Darwin/macOS.

module Test.Utils.Darwin
( pendingOnMacOS
) where

import Prelude

import Control.Monad
( when )
import System.Info
( os )
import Test.Hspec.Core.Spec
( pendingWith )
import Test.Hspec.Expectations
( Expectation, HasCallStack )

-- | Mark test pending if running on macOS
pendingOnMacOS :: HasCallStack => String -> Expectation
pendingOnMacOS reason = when isDarwin $ pendingWith reason

isDarwin :: Bool
isDarwin = os == "darwin"