File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
rules_haskell_tests/tests Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import Control.Exception.Safe (bracket_)
7
7
import Data.Foldable (for_ )
8
8
import Data.List (isInfixOf , sort )
9
9
import GHC.Stack (HasCallStack )
10
- import System.Directory (copyFile )
10
+ import System.Directory (copyFile , doesFileExist )
11
11
import System.FilePath ((</>) )
12
12
import System.Info (os )
13
13
import System.IO.Temp (withSystemTempDirectory )
@@ -202,10 +202,10 @@ topPath = "/usr/bin/top"
202
202
printMemory :: String -> IO ()
203
203
printMemory msg = do
204
204
-- Do not attempt to run top, if it does not exist.
205
- (exitCode, _, _) <- Process. readProcessWithExitCode " test " [ topPath] " "
206
- case exitCode of
207
- ExitSuccess -> _doPrintMemory msg
208
- ExitFailure _ -> pure ()
205
+ topExists <- doesFileExist topPath
206
+ if topExists
207
+ then _doPrintMemory msg
208
+ else pure ()
209
209
210
210
-- | Print information about the current memory state to debug intermittent failures
211
211
-- Related to https://github.com/tweag/rules_haskell/issues/2089
You can’t perform that action at this time.
0 commit comments