Skip to content

Commit 23a9869

Browse files
committed
Remove createDirectoryIfMissingNew changes (passes CI)
Removed handleException changes (testing)
1 parent c2484e1 commit 23a9869

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

cardano-testnet/src/Testnet/Runtime.hs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import GHC.Stack
4444
import qualified GHC.Stack as GHC
4545
import Network.Socket (HostAddress, PortNumber)
4646
import Prettyprinter (unAnnotate)
47-
import RIO (runRIO, threadDelay)
47+
import RIO (runRIO)
4848
import qualified System.Directory as IO
4949
import System.FilePath
5050
import qualified System.IO as IO
@@ -253,16 +253,7 @@ startNode tp node ipv4 port _testnetMagic nodeCmd = GHC.withFrozenCallStack $ do
253253
createDirectoryIfMissingNew :: HasCallStack => FilePath -> IO FilePath
254254
createDirectoryIfMissingNew 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

268259
createSubdirectoryIfMissingNew :: ()
@@ -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

357341
calculateEpochStateDiff

0 commit comments

Comments
 (0)