diff --git a/.github/workflows/applications.yml b/.github/workflows/applications.yml index 3497be786f..67f828156d 100644 --- a/.github/workflows/applications.yml +++ b/.github/workflows/applications.yml @@ -499,7 +499,7 @@ jobs: ghc: ${{ matrix.ghc }} use-freeze-file: ${{ matrix.use-freeze-file }} - name: Run multi-node-network-tests - timeout-minutes: 10 + timeout-minutes: 20 run: | ulimit -n 10000 multi-node-network-tests diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index c3806a0afc..bc59c39e1a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -2,10 +2,11 @@ name: Build and cache with Nix on: workflow_dispatch: - push: - paths: - - '**' - # - '!.github/**' + +## For now disable NIX (until is maintained again) +# push: +# paths: +# - '**' jobs: build-and-cache: diff --git a/test/lib/Chainweb/Test/MultiNode.hs b/test/lib/Chainweb/Test/MultiNode.hs index 5c77e78034..f23b4e427f 100644 --- a/test/lib/Chainweb/Test/MultiNode.hs +++ b/test/lib/Chainweb/Test/MultiNode.hs @@ -87,8 +87,7 @@ import System.Directory (createDirectoryIfMissing) import System.FilePath import System.IO.Temp import System.LogLevel -import System.Timeout - +import GHC.Conc (listThreads) import Test.Tasty.HUnit import PropertyMatchers qualified as P @@ -331,8 +330,18 @@ runNodesForSeconds -> (forall logger. NodeId -> StartedChainweb logger -> IO ()) -> IO () runNodesForSeconds loglevel write v confBuilders (Seconds seconds) rdb pactDbDir inner = do - void $ timeout (int seconds * 1_000_000) - $ runNodes loglevel write v confBuilders rdb pactDbDir inner + + intialThreads <- Set.fromList <$> listThreads + + void $ race (threadDelay (int seconds * 1_000_000)) (runNodes loglevel write v confBuilders rdb pactDbDir inner) + + -- Give threads 2 seconds to stop properly + threadDelay 2_000_000 + + -- And kill those created during the test + survivingThreads <- filter (flip Set.notMember intialThreads) <$> listThreads + write $ T.pack $ "Killing " ++ (show $ length survivingThreads) ++ " garbage threads" + forM_ survivingThreads killThread -- | Ensure that we can compact a live node(s). --