Send CRRemote*Stopped on all errors (#3376)

* Send CRRemote*Stopped on all errors

Commands use the same action, made idempotent and don't send events.

* fix tests

* get http2 cancelling back
This commit is contained in:
Alexander Bondarenko
2023-11-15 19:31:36 +02:00
committed by GitHub
parent a75fce8dfa
commit 339c3d2be1
5 changed files with 45 additions and 47 deletions
+5 -15
View File
@@ -1,7 +1,6 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE OverloadedStrings #-}
module RemoteTests where
@@ -40,7 +39,7 @@ remoteTests = describe "Remote" $ do
it "sends messages" remoteMessageTest
describe "remote files" $ do
it "store/get/send/receive files" remoteStoreFileTest
it "should send files from CLI wihtout /store" remoteCLIFileTest
it "should send files from CLI without /store" remoteCLIFileTest
it "switches remote hosts" switchRemoteHostTest
it "indicates remote hosts" indicateRemoteHostTest
@@ -439,24 +438,15 @@ stopDesktop :: HasCallStack => TestCC -> TestCC -> IO ()
stopDesktop mobile desktop = do
logWarn "stopping via desktop"
desktop ##> "/stop remote host 1"
-- desktop <## "ok"
concurrentlyN_
[ do
desktop <## "remote host 1 stopped"
desktop <## "ok",
eventually 3 $ mobile <## "remote controller stopped"
]
desktop <## "ok"
eventually 3 $ mobile <## "remote controller stopped"
stopMobile :: HasCallStack => TestCC -> TestCC -> IO ()
stopMobile mobile desktop = do
logWarn "stopping via mobile"
mobile ##> "/stop remote ctrl"
concurrentlyN_
[ do
mobile <## "remote controller stopped"
mobile <## "ok",
eventually 3 $ desktop <## "remote host 1 stopped"
]
mobile <## "ok"
eventually 3 $ desktop <## "remote host 1 stopped"
-- | Run action with extended timeout
eventually :: Int -> IO a -> IO a