mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-25 14:14:54 +00:00
fix more nGet/UP
This commit is contained in:
@@ -39,6 +39,7 @@ module AgentTests.FunctionalAPITests
|
||||
rfGet,
|
||||
sfGet,
|
||||
nGet,
|
||||
nGetUP,
|
||||
(##>),
|
||||
(=##>),
|
||||
pattern CON,
|
||||
|
||||
@@ -19,6 +19,7 @@ import AgentTests.FunctionalAPITests
|
||||
joinConnection,
|
||||
makeConnection,
|
||||
nGet,
|
||||
nGetUP,
|
||||
runRight,
|
||||
runRight_,
|
||||
sendMessage,
|
||||
@@ -594,8 +595,8 @@ testNotificationsSMPRestart t APNSMockServer {apnsQ} = withAgentClients2 $ \alic
|
||||
nGet bob =##> \case ("", "", DOWN _ [c]) -> c == aliceId; _ -> False
|
||||
|
||||
withSmpServerStoreLogOn t testPort $ \threadId -> runRight_ $ do
|
||||
nGet alice =##> \case ("", "", UP _ [c]) -> c == bobId; _ -> False
|
||||
nGet bob =##> \case ("", "", UP _ [c]) -> c == aliceId; _ -> False
|
||||
nGetUP alice =##> \case ("", "", UP _ [c]) -> c == bobId; _ -> False
|
||||
nGetUP bob =##> \case ("", "", UP _ [c]) -> c == aliceId; _ -> False
|
||||
liftIO $ threadDelay 1000000
|
||||
5 <- sendMessage bob aliceId (SMP.MsgFlags True) "hello again"
|
||||
get bob ##> ("", aliceId, SENT 5)
|
||||
@@ -628,11 +629,11 @@ testNotificationsSMPRestartBatch n t APNSMockServer {apnsQ} =
|
||||
liftIO $ length (acs1 <> acs2) `shouldBe` length conns
|
||||
|
||||
runServers $ do
|
||||
("", "", UP _ bcs1) <- nGet a
|
||||
("", "", UP _ bcs2) <- nGet a
|
||||
("", "", UP _ bcs1) <- nGetUP a
|
||||
("", "", UP _ bcs2) <- nGetUP a
|
||||
liftIO $ length (bcs1 <> bcs2) `shouldBe` length conns
|
||||
("", "", UP _ acs1) <- nGet b
|
||||
("", "", UP _ acs2) <- nGet b
|
||||
("", "", UP _ acs1) <- nGetUP b
|
||||
("", "", UP _ acs2) <- nGetUP b
|
||||
liftIO $ length (acs1 <> acs2) `shouldBe` length conns
|
||||
liftIO $ threadDelay 1500000
|
||||
forM_ conns $ \(aliceId, bobId) -> do
|
||||
|
||||
@@ -348,7 +348,7 @@ agentViaProxyRetryOffline = do
|
||||
withServer2 = withServer_ testStoreLogFile2 testStoreMsgsFile2 testPort2
|
||||
withServer_ storeLog storeMsgs port =
|
||||
withSmpServerConfigOn (transport @TLS) proxyCfg {storeLogFile = Just storeLog, storeMsgsFile = Just storeMsgs} port
|
||||
a `up` cId = nGet a =##> \case ("", "", UP _ [c]) -> c == cId; _ -> False
|
||||
a `up` cId = nGetUP a =##> \case ("", "", UP _ [c]) -> c == cId; _ -> False
|
||||
a `down` cId = nGet a =##> \case ("", "", DOWN _ [c]) -> c == cId; _ -> False
|
||||
aCfg = agentProxyCfg {messageRetryInterval = fastMessageRetryInterval}
|
||||
baseId = 3
|
||||
|
||||
Reference in New Issue
Block a user