@@ -44,7 +44,7 @@ import GHC.Stack
4444import qualified GHC.Stack as GHC
4545import Network.Socket (HostAddress , PortNumber )
4646import Prettyprinter (unAnnotate )
47- import RIO (runRIO , threadDelay )
47+ import RIO (runRIO )
4848import qualified System.Directory as IO
4949import System.FilePath
5050import qualified System.IO as IO
@@ -253,16 +253,7 @@ startNode tp node ipv4 port _testnetMagic nodeCmd = GHC.withFrozenCallStack $ do
253253createDirectoryIfMissingNew :: HasCallStack => FilePath -> IO FilePath
254254createDirectoryIfMissingNew directory = GHC. withFrozenCallStack $ do
255255 IO. createDirectoryIfMissing True directory
256- exists <- IO. doesDirectoryExist directory
257- if exists
258- then pure directory
259- else do
260- threadDelay 5_000_000
261- IO. createDirectoryIfMissing True directory
262- exists' <- IO. doesDirectoryExist directory
263- if exists'
264- then pure directory
265- else throwString $ " Failed to create directory: " <> directory
256+ pure directory
266257
267258
268259createSubdirectoryIfMissingNew :: ()
@@ -343,15 +334,8 @@ startLedgerNewEpochStateLogging testnetRuntime tmpWorkspace = withFrozenCallStac
343334 -- | Handle all sync exceptions and log them into the log file. We don't want to fail the test just
344335 -- because logging has failed.
345336 handleException = handle $ \ (e :: SomeException ) -> do
346- exists <- liftIO $ IO. doesFileExist outputFp
347- if exists
348- then liftIOAnnotated $ appendFile outputFp $ " Ledger new epoch logging failed - caught exception:\n "
349- <> displayException e <> " \n "
350- else do
351- liftIO $ writeFile outputFp $ unlines
352- [" Ledger new epoch logging failed - caught exception:"
353- , displayException e
354- ]
337+ liftIOAnnotated $ appendFile outputFp $ " Ledger new epoch logging failed - caught exception:\n "
338+ <> displayException e <> " \n "
355339 pure ConditionMet
356340
357341calculateEpochStateDiff
0 commit comments