Skip to content

Commit

Permalink
Graceful shutdown of TUISpec to avoid BlockedIndefinitely exceptions
Browse files Browse the repository at this point in the history
It seems they are thrown because the runWithVty / brick application is
terminated by the race_. Also, we wouldn't be able to catch
`BlockedIndefinitely` as its not exported by io-classes.
  • Loading branch information
ch1bo committed Jan 10, 2022
1 parent 8f436ee commit 0f282a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hydra-tui/test/Hydra/TUISpec.hs
Expand Up @@ -48,9 +48,10 @@ spec =
around setupNodeAndTUI $
context "end-to-end smoke tests" $ do
it "starts & renders" $
\TUITest{shouldRender} -> do
\TUITest{sendInputEvent, shouldRender} -> do
threadDelay 1
shouldRender "TUI"
sendInputEvent $ EvKey (KChar 'q') []

it "supports the init & abort Head life cycle" $
\TUITest{sendInputEvent, shouldRender} -> do
Expand All @@ -63,6 +64,7 @@ spec =
sendInputEvent $ EvKey (KChar 'a') []
threadDelay 1
shouldRender "Ready"
sendInputEvent $ EvKey (KChar 'q') []

it "supports the full Head life cycle" $
\TUITest{sendInputEvent, shouldRender} -> do
Expand All @@ -86,6 +88,7 @@ spec =
threadDelay 10 -- contestation period
shouldRender "Final"
shouldRender "900.000000"
sendInputEvent $ EvKey (KChar 'q') []

setupNodeAndTUI :: (TUITest -> IO ()) -> IO ()
setupNodeAndTUI action =
Expand Down

0 comments on commit 0f282a5

Please sign in to comment.