Skip to content

Commit

Permalink
wait for chain-index longer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekeke committed Aug 26, 2022
1 parent a6c487f commit 8f8731f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Test/Plutip/Internal/LocalCluster.hs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ waitForRelayNode trCluster rn =
tip <- getTip
case tip of
(ChainTip (SlotNo _) _ _) -> pure ()
_ -> throwString "Timeout waiting for node to start"
a -> throwString $ "Timeout waiting for node to start. Last 'tip' response: " <> show a
pure ()

-- | Launch the chain index in a separate thread.
Expand All @@ -284,12 +284,12 @@ launchChainIndex conf (RunningNode sp _block0 (netParams, _vData) _) dir = do
toMilliseconds = floor . (1e3 *) . nominalDiffTimeToSeconds

waitForChainIndex port = do
let policy = constantDelay 500000 <> limitRetries 50
let policy = constantDelay 1_000_000 <> limitRetries (3 * 60)
recoverAll policy $ \_ -> do
tip <- queryTipWithChIndex port
case tip of
Right (Tip (Slot _) _ _) -> pure ()
_ -> throwString "Timeout waiting for chain-index to start"
a -> throwString $ "Timeout waiting for chain-index to start indexing. Last response: " <> show a

queryTipWithChIndex port = do
manager' <- newManager defaultManagerSettings
Expand Down

0 comments on commit 8f8731f

Please sign in to comment.