Skip to content

Commit

Permalink
fixup! Set CARDANO_NODE_SOCKET_PATH only in child processes
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jan 11, 2021
1 parent bc716ef commit 2733fa0
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions lib/shelley/test/integration/Main.hs
Expand Up @@ -237,23 +237,21 @@ specWithServer testDir (tr, tracers) era = aroundAll withContext
ctx <- newEmptyMVar
poolGarbageCollectionEvents <- newIORef []
let dbEventRecorder =
recordPoolGarbageCollectionEvents poolGarbageCollectionEvents
recordPoolGarbageCollectionEvents poolGarbageCollectionEvents
let setupContext smashUrl np wAddr = bracketTracer' tr "setupContext" $ do
let baseUrl = "http://" <> T.pack (show wAddr) <> "/"
prometheusUrl <- (maybe "none" (\(h, p) -> T.pack h <> ":" <> toText @(Port "Prometheus") p)) <$> getPrometheusURL
ekgUrl <- (maybe "none" (\(h, p) -> T.pack h <> ":" <> toText @(Port "EKG") p)) <$> getEKGURL
traceWith tr $
MsgBaseUrl baseUrl ekgUrl prometheusUrl smashUrl
traceWith tr $ MsgBaseUrl baseUrl ekgUrl prometheusUrl smashUrl
let fiveMinutes = 300 * 1000 * 1000 -- 5 minutes in microseconds
manager <- (baseUrl,) <$> newManager ( defaultManagerSettings
{ managerResponseTimeout =
responseTimeoutMicro fiveMinutes
})
manager <- newManager $ defaultManagerSettings
{ managerResponseTimeout = responseTimeoutMicro fiveMinutes
}
faucet <- initFaucet

putMVar ctx $ Context
{ _cleanup = pure ()
, _manager = manager
, _manager = (baseUrl, manager)
, _walletPort = Port . fromIntegral $ unsafePortNumber wAddr
, _faucet = faucet
, _feeEstimator = error "feeEstimator: unused in shelley specs"
Expand All @@ -274,8 +272,8 @@ specWithServer testDir (tr, tracers) era = aroundAll withContext
-- a 'PoolGarbageCollectionEvent' value to the start of the given log.
--
recordPoolGarbageCollectionEvents
:: IORef [PoolGarbageCollectionEvent]
-> Pool.DBDecorator IO
:: IORef [PoolGarbageCollectionEvent]
-> Pool.DBDecorator IO
recordPoolGarbageCollectionEvents eventsRef = Pool.DBDecorator decorate
where
decorate Pool.DBLayer {..} =
Expand All @@ -285,8 +283,8 @@ specWithServer testDir (tr, tracers) era = aroundAll withContext
certificates <- removeRetiredPools epochNo
let event = PoolGarbageCollectionEvent epochNo certificates
liftIO $ do
traceWith tr $ MsgPoolGarbageCollectionEvent event
atomicModifyIORef' eventsRef ((,()) . (event :))
traceWith tr $ MsgPoolGarbageCollectionEvent event
atomicModifyIORef' eventsRef ((,()) . (event :))
pure certificates

withServer dbDecorator onReady = bracketTracer' tr "withServer" $
Expand Down Expand Up @@ -371,7 +369,7 @@ instance HasSeverityAnnotation TestsLog where
MsgBaseUrl {} -> Notice
MsgCluster msg -> getSeverityAnnotation msg
MsgPoolGarbageCollectionEvent _ -> Info
MsgServerError {} -> Critical
MsgServerError{} -> Critical

withTracers
:: FilePath
Expand All @@ -382,9 +380,9 @@ withTracers testDir action = do
minSev <- getMinSev
logDir <- fromMaybe testDir <$> testLogDirFromEnv
pure
[ LogToFile (logDir </> name) (min minSev Info)
, LogToStdout minSev
]
[ LogToFile (logDir </> name) (min minSev Info)
, LogToStdout minSev
]

walletLogOutputs <- getLogOutputs walletMinSeverityFromEnv "wallet.log"
testLogOutputs <- getLogOutputs testMinSeverityFromEnv "test.log"
Expand Down

0 comments on commit 2733fa0

Please sign in to comment.