fix more nGet/UP

This commit is contained in:
Alexander Bondarenko
2024-05-30 17:30:44 +03:00
parent c76d16758e
commit dcbda5ab69
3 changed files with 9 additions and 7 deletions
+1
View File
@@ -39,6 +39,7 @@ module AgentTests.FunctionalAPITests
rfGet,
sfGet,
nGet,
nGetUP,
(##>),
(=##>),
pattern CON,
+7 -6
View File
@@ -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
+1 -1
View File
@@ -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