Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 13 additions & 4 deletions test/lib/Chainweb/Test/MultiNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
--
Expand Down