From cab53c67acb9356b1e429fe32cd4fe8bf0689851 Mon Sep 17 00:00:00 2001 From: David Simmons-Duffin Date: Sun, 31 Mar 2024 16:48:32 -0700 Subject: [PATCH] Bump Cabal version for tests; change port in TCP test to 0 --- .../distributed-process-tests.cabal | 10 +++++++++- .../Distributed/Process/Tests/Internal/Utils.hs | 4 ++-- distributed-process-tests/tests/runTCP.hs | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/distributed-process-tests/distributed-process-tests.cabal b/distributed-process-tests/distributed-process-tests.cabal index a3031254..1321ca2e 100644 --- a/distributed-process-tests/distributed-process-tests.cabal +++ b/distributed-process-tests/distributed-process-tests.cabal @@ -10,7 +10,7 @@ Maintainer: Tim Watson copyright: Well-Typed LLP category: Control, Cloud Haskell build-type: Simple -cabal-version: >=1.8 +cabal-version: >=1.10 flag tcp Description: build and run TCP tests @@ -42,6 +42,7 @@ library test-framework-hunit >= 0.2.0 && < 0.4, stm hs-source-dirs: src + default-language: Haskell98 ghc-options: -Wall -fno-warn-unused-do-bind extensions: CPP, ExistentialQuantification, @@ -66,6 +67,7 @@ Test-Suite TestCHInMemory network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -83,6 +85,7 @@ Test-Suite TestCHInTCP else Buildable: False Extensions: CPP + default-language: Haskell98 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -98,6 +101,7 @@ Test-Suite TestClosure network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -112,6 +116,7 @@ Test-Suite TestStats network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -126,6 +131,7 @@ Test-Suite TestMxInMemory network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -140,6 +146,7 @@ Test-Suite TestTracingInMemory network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -154,5 +161,6 @@ Test-Suite TestMxInTCP network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP + default-language: Haskell98 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests diff --git a/distributed-process-tests/src/Control/Distributed/Process/Tests/Internal/Utils.hs b/distributed-process-tests/src/Control/Distributed/Process/Tests/Internal/Utils.hs index ff13ae12..65152227 100644 --- a/distributed-process-tests/src/Control/Distributed/Process/Tests/Internal/Utils.hs +++ b/distributed-process-tests/src/Control/Distributed/Process/Tests/Internal/Utils.hs @@ -188,8 +188,8 @@ newLogger = do _ <- forkIO $ logger q return $ Logger tid q where logger q' = forever $ do - msg <- atomically $ readTQueue q' - putStrLn msg + msg <- atomically $ readTQueue q' + putStrLn msg -- | Send a message to the Logger putLogMsg :: Logger -> String -> Process () diff --git a/distributed-process-tests/tests/runTCP.hs b/distributed-process-tests/tests/runTCP.hs index 58a4c068..903aee26 100644 --- a/distributed-process-tests/tests/runTCP.hs +++ b/distributed-process-tests/tests/runTCP.hs @@ -25,7 +25,7 @@ main = do hSetBuffering stdout LineBuffering hSetBuffering stderr LineBuffering Right (transport, internals) <- - createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "8080") + createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "0") defaultTCPParameters { transportConnectTimeout = Just 3000000 } ts <- tests TestTransport { testTransport = transport