Skip to content

Commit 812c47d

Browse files
committed
Update comments.
1 parent d9164b1 commit 812c47d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

rules_haskell_tests/tests/RunTests.hs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,22 @@ bazel args = Process.proc "bazel" args
168168
bazelQuery :: String -> SpecM a [String]
169169
bazelQuery q = lines <$> runIO (Process.readProcess "bazel" ["query", q] "")
170170

171+
-- | Shutdown Bazel
171172
shutdownBazel :: IO ()
172173
shutdownBazel = do
173-
-- DEBUG BEGIN
174-
printMem "BEFORE"
175-
-- DEBUG END
174+
-- Related to https://github.com/tweag/rules_haskell/issues/2089
175+
-- We experience intermittent "Exit Code: ExitFailure (-9)" errors. Added the
176+
-- printMemory calls to help us debug when the error happens again.
177+
printMemory "BEFORE"
176178
assertSuccess (bazel ["shutdown"])
177-
-- DEBUG BEGIN
178-
printMem "AFTER"
179-
-- DEBUG END
179+
printMemory "AFTER"
180180
pure ()
181181

182-
printMem :: String -> IO ()
183-
printMem msg = do
182+
-- | Print information about the current memory state to debug intermittent failures
183+
-- Related to https://github.com/tweag/rules_haskell/issues/2089
184+
printMemory :: String -> IO ()
185+
printMemory msg = do
184186
putStrLn msg
185-
-- (_, stdOut, _) <- Process.readProcessWithExitCode "/usr/bin/memory_pressure" [] ""
186187
(_, stdOut, _) <- Process.readProcessWithExitCode "/usr/bin/top" ["-l", "1", "-s", "0", "-o", "mem", "-n", "15"] ""
187188
putStrLn stdOut
188189

0 commit comments

Comments
 (0)