agent: enable fast handshake (revert #1215) (#1216)

* Revert "agent: disable fast handshake (#1215)"

This reverts commit aa1d8d6c8b.

* remove import

* test delays
This commit is contained in:
Evgeny Poberezkin
2024-07-03 18:05:27 +01:00
committed by GitHub
parent ae8e1c5e9a
commit ce732c0efb
4 changed files with 78 additions and 78 deletions

View File

@@ -157,7 +157,6 @@ import Simplex.Messaging.Agent.NtfSubSupervisor
import Simplex.Messaging.Agent.Protocol
import Simplex.Messaging.Agent.RetryInterval
import Simplex.Messaging.Agent.Stats
import Simplex.Messaging.Agent.Stats (AgentSMPServerStats (connSubErrs))
import Simplex.Messaging.Agent.Store
import Simplex.Messaging.Agent.Store.SQLite
import qualified Simplex.Messaging.Agent.Store.SQLite.DB as DB
@@ -739,7 +738,7 @@ newRcvConnSrv c userId connId enableNtfs cMode clientData pqInitKeys subMode srv
(SCMContact, CR.IKUsePQ) -> throwE $ CMD PROHIBITED "newRcvConnSrv"
_ -> pure ()
AgentConfig {smpClientVRange, smpAgentVRange, e2eEncryptVRange} <- asks config
let sndSecure = False -- case cMode of SCMInvitation -> True; SCMContact -> False
let sndSecure = case cMode of SCMInvitation -> True; SCMContact -> False
(rq, qUri, tSess, sessId) <- newRcvQueue c userId connId srvWithAuth smpClientVRange subMode sndSecure `catchAgentError` \e -> liftIO (print e) >> throwE e
atomically $ incSMPServerStat c userId srv connCreated
rq' <- withStore c $ \db -> updateNewConnRcv db connId rq
@@ -883,7 +882,7 @@ joinConnSrvAsync _c _userId _connId _enableNtfs (CRContactUri _) _cInfo _subMode
createReplyQueue :: AgentClient -> ConnData -> SndQueue -> SubscriptionMode -> SMPServerWithAuth -> AM SMPQueueInfo
createReplyQueue c ConnData {userId, connId, enableNtfs} SndQueue {smpClientVersion} subMode srv = do
let sndSecure = False -- smpClientVersion >= sndAuthKeySMPClientVersion
let sndSecure = smpClientVersion >= sndAuthKeySMPClientVersion
(rq, qUri, tSess, sessId) <- newRcvQueue c userId connId srv (versionToRange smpClientVersion) subMode sndSecure
atomically $ incSMPServerStat c userId (qServer rq) connCreated
let qInfo = toVersionT qUri smpClientVersion

View File

@@ -257,11 +257,11 @@ functionalAPITests :: ATransport -> Spec
functionalAPITests t = do
describe "Establishing duplex connection" $ do
testMatrix2 t runAgentClientTest
xit "should connect when server with multiple identities is stored" $
it "should connect when server with multiple identities is stored" $
withSmpServer t testServerMultipleIdentities
xit "should connect with two peers" $
it "should connect with two peers" $
withSmpServer t testAgentClient3
xit "should establish connection without PQ encryption and enable it" $
it "should establish connection without PQ encryption and enable it" $
withSmpServer t testEnablePQEncryption
describe "Establishing duplex connection, different PQ settings" $ do
testPQMatrix2 t $ runAgentClientTestPQ True
@@ -290,43 +290,43 @@ functionalAPITests t = do
testAllowConnectionClientRestart t
describe "Message delivery" $ do
describe "update connection agent version on received messages" $ do
xit "should increase if compatible, shouldn't decrease" $
it "should increase if compatible, shouldn't decrease" $
testIncreaseConnAgentVersion t
xit "should increase to max compatible version" $
it "should increase to max compatible version" $
testIncreaseConnAgentVersionMaxCompatible t
xit "should increase when connection was negotiated on different versions" $
it "should increase when connection was negotiated on different versions" $
testIncreaseConnAgentVersionStartDifferentVersion t
-- TODO PQ tests for upgrading connection to PQ encryption
xit "should deliver message after client restart" $
it "should deliver message after client restart" $
testDeliverClientRestart t
xit "should deliver messages to the user once, even if repeat delivery is made by the server (no ACK)" $
it "should deliver messages to the user once, even if repeat delivery is made by the server (no ACK)" $
testDuplicateMessage t
xit "should report error via msg integrity on skipped messages" $
it "should report error via msg integrity on skipped messages" $
testSkippedMessages t
xit "should connect to the server when server goes up if it initially was down" $
it "should connect to the server when server goes up if it initially was down" $
testDeliveryAfterSubscriptionError t
xit "should deliver messages if one of connections has quota exceeded" $
it "should deliver messages if one of connections has quota exceeded" $
testMsgDeliveryQuotaExceeded t
describe "message expiration" $ do
xit "should expire one message" $ testExpireMessage t
xit "should expire multiple messages" $ testExpireManyMessages t
xit "should expire one message if quota is exceeded" $ testExpireMessageQuota t
xit "should expire multiple messages if quota is exceeded" $ testExpireManyMessagesQuota t
it "should expire one message" $ testExpireMessage t
it "should expire multiple messages" $ testExpireManyMessages t
it "should expire one message if quota is exceeded" $ testExpireMessageQuota t
it "should expire multiple messages if quota is exceeded" $ testExpireManyMessagesQuota t
describe "Ratchet synchronization" $ do
xit "should report ratchet de-synchronization, synchronize ratchets" $
it "should report ratchet de-synchronization, synchronize ratchets" $
testRatchetSync t
xit "should synchronize ratchets after server being offline" $
it "should synchronize ratchets after server being offline" $
testRatchetSyncServerOffline t
xit "should synchronize ratchets after client restart" $
it "should synchronize ratchets after client restart" $
testRatchetSyncClientRestart t
xit "should synchronize ratchets after suspend/foreground" $
it "should synchronize ratchets after suspend/foreground" $
testRatchetSyncSuspendForeground t
xit "should synchronize ratchets when clients start synchronization simultaneously" $
it "should synchronize ratchets when clients start synchronization simultaneously" $
testRatchetSyncSimultaneous t
describe "Subscription mode OnlyCreate" $ do
it "messages delivered only when polled (v8 - slow handshake)" $
withSmpServer t testOnlyCreatePullSlowHandshake
xit "messages delivered only when polled" $
it "messages delivered only when polled" $
withSmpServer t testOnlyCreatePull
describe "Inactive client disconnection" $ do
it "should disconnect clients without subs if they were inactive longer than TTL" $
@@ -336,14 +336,14 @@ functionalAPITests t = do
it "should NOT disconnect active clients" $
testActiveClientNotDisconnected t
describe "Suspending agent" $ do
xit "should update client when agent is suspended" $
it "should update client when agent is suspended" $
withSmpServer t testSuspendingAgent
xit "should complete sending messages when agent is suspended" $
it "should complete sending messages when agent is suspended" $
testSuspendingAgentCompleteSending t
xit "should suspend agent on timeout, even if pending messages not sent" $
it "should suspend agent on timeout, even if pending messages not sent" $
testSuspendingAgentTimeout t
describe "Batching SMP commands" $ do
xit "should subscribe to multiple (200) subscriptions with batching" $
it "should subscribe to multiple (200) subscriptions with batching" $
testBatchedSubscriptions 200 10 t
skip "faster version of the previous test (200 subscriptions gets very slow with test coverage)" $
it "should subscribe to multiple (6) subscriptions with batching" $
@@ -362,7 +362,7 @@ functionalAPITests t = do
testDeleteConnectionAsync t
it "join connection when reply queue creation fails (v8 - slow handshake)" $
testJoinConnectionAsyncReplyErrorV8 t
xit "join connection when reply queue creation fails" $
it "join connection when reply queue creation fails" $
testJoinConnectionAsyncReplyError t
describe "delete connection waiting for delivery" $ do
it "should delete connection immediately if there are no pending messages" $
@@ -376,34 +376,34 @@ functionalAPITests t = do
it "should delete connection by timeout, message in progress can be delivered" $
testWaitDeliveryTimeout2 t
describe "Users" $ do
xit "should create and delete user with connections" $
it "should create and delete user with connections" $
withSmpServer t testUsers
xit "should create and delete user without connections" $
it "should create and delete user without connections" $
withSmpServer t testDeleteUserQuietly
xit "should create and delete user with connections when server connection fails" $
it "should create and delete user with connections when server connection fails" $
testUsersNoServer t
xit "should connect two users and switch session mode" $
it "should connect two users and switch session mode" $
withSmpServer t testTwoUsers
describe "Connection switch" $ do
xdescribe "should switch delivery to the new queue" $
describe "should switch delivery to the new queue" $
testServerMatrix2 t testSwitchConnection
xdescribe "should switch to new queue asynchronously" $
describe "should switch to new queue asynchronously" $
testServerMatrix2 t testSwitchAsync
describe "should delete connection during switch" $
testServerMatrix2 t testSwitchDelete
xdescribe "should abort switch in Started phase" $
describe "should abort switch in Started phase" $
testServerMatrix2 t testAbortSwitchStarted
xdescribe "should abort switch in Started phase, reinitiate immediately" $
describe "should abort switch in Started phase, reinitiate immediately" $
testServerMatrix2 t testAbortSwitchStartedReinitiate
xdescribe "should prohibit to abort switch in Secured phase" $
describe "should prohibit to abort switch in Secured phase" $
testServerMatrix2 t testCannotAbortSwitchSecured
xdescribe "should switch two connections simultaneously" $
describe "should switch two connections simultaneously" $
testServerMatrix2 t testSwitch2Connections
xdescribe "should switch two connections simultaneously, abort one" $
describe "should switch two connections simultaneously, abort one" $
testServerMatrix2 t testSwitch2ConnectionsAbort1
describe "SMP basic auth" $ do
let v4 = prevVersion basicAuthSMPVersion
forM_ (nub [prevVersion authCmdsSMPVersion, authCmdsSMPVersion, prevVersion currentServerSMPRelayVersion]) $ \v -> do
forM_ (nub [prevVersion authCmdsSMPVersion, authCmdsSMPVersion, currentServerSMPRelayVersion]) $ \v -> do
let baseId = if v >= sndAuthKeySMPVersion then 1 else 3
describe ("v" <> show v <> ": with server auth") $ do
-- allow NEW | server auth, v | clnt1 auth, v | clnt2 auth, v | 2 - success, 1 - JOIN fail, 0 - NEW fail
@@ -444,15 +444,15 @@ functionalAPITests t = do
it "should return the same data for both peers" $
withSmpServer t testRatchetAdHash
describe "Delivery receipts" $ do
xit "should send and receive delivery receipt" $ withSmpServer t testDeliveryReceipts
xit "should send delivery receipt only in connection v3+" $ testDeliveryReceiptsVersion t
it "should send and receive delivery receipt" $ withSmpServer t testDeliveryReceipts
it "should send delivery receipt only in connection v3+" $ testDeliveryReceiptsVersion t
it "send delivery receipts concurrently with messages" $ testDeliveryReceiptsConcurrent t
describe "user network info" $ do
it "should wait for user network" testWaitForUserNetwork
it "should not reset online to offline if happens too quickly" testDoNotResetOnlineToOffline
it "should resume multiple threads" testResumeMultipleThreads
describe "SMP queue info" $ do
xit "server should respond with queue and subscription information" $
it "server should respond with queue and subscription information" $
withSmpServer t testServerQueueInfo
testBasicAuth :: ATransport -> Bool -> (Maybe BasicAuth, VersionSMP) -> (Maybe BasicAuth, VersionSMP) -> (Maybe BasicAuth, VersionSMP) -> AgentMsgId -> IO Int
@@ -475,28 +475,28 @@ canCreateQueue allowNew (srvAuth, srvVersion) (clntAuth, clntVersion) =
testMatrix2 :: HasCallStack => ATransport -> (PQSupport -> Bool -> AgentClient -> AgentClient -> AgentMsgId -> IO ()) -> Spec
testMatrix2 t runTest = do
xit "current, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentCfg agentCfg (initAgentServersProxy SPMAlways SPFProhibit) 1 $ runTest PQSupportOn True
it "current, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentCfg agentCfg (initAgentServersProxy SPMAlways SPFProhibit) 1 $ runTest PQSupportOn True
it "v8, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentProxyCfgV8 agentProxyCfgV8 (initAgentServersProxy SPMAlways SPFProhibit) 3 $ runTest PQSupportOn True
xit "current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest PQSupportOn False
it "current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest PQSupportOn False
it "prev" $ withSmpServer t $ runTestCfg2 agentCfgVPrev agentCfgVPrev 3 $ runTest PQSupportOff False
it "prev to current" $ withSmpServer t $ runTestCfg2 agentCfgVPrev agentCfg 3 $ runTest PQSupportOff False
it "current to prev" $ withSmpServer t $ runTestCfg2 agentCfg agentCfgVPrev 3 $ runTest PQSupportOff False
testBasicMatrix2 :: HasCallStack => ATransport -> (AgentClient -> AgentClient -> AgentMsgId -> IO ()) -> Spec
testBasicMatrix2 t runTest = do
xit "current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest
it "current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest
it "prev" $ withSmpServer t $ runTestCfg2 agentCfgVPrevPQ agentCfgVPrevPQ 3 $ runTest
it "prev to current" $ withSmpServer t $ runTestCfg2 agentCfgVPrevPQ agentCfg 3 $ runTest
it "current to prev" $ withSmpServer t $ runTestCfg2 agentCfg agentCfgVPrevPQ 3 $ runTest
testRatchetMatrix2 :: HasCallStack => ATransport -> (PQSupport -> Bool -> AgentClient -> AgentClient -> AgentMsgId -> IO ()) -> Spec
testRatchetMatrix2 t runTest = do
xit "current, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentCfg agentCfg (initAgentServersProxy SPMAlways SPFProhibit) 1 $ runTest PQSupportOn True
it "current, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentCfg agentCfg (initAgentServersProxy SPMAlways SPFProhibit) 1 $ runTest PQSupportOn True
it "v8, via proxy" $ withSmpServerProxy t $ runTestCfgServers2 agentProxyCfgV8 agentProxyCfgV8 (initAgentServersProxy SPMAlways SPFProhibit) 3 $ runTest PQSupportOn True
xit "ratchet current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest PQSupportOn False
xit "ratchet prev" $ withSmpServer t $ runTestCfg2 agentCfgRatchetVPrev agentCfgRatchetVPrev 1 $ runTest PQSupportOff False
xit "ratchets prev to current" $ withSmpServer t $ runTestCfg2 agentCfgRatchetVPrev agentCfg 1 $ runTest PQSupportOff False
xit "ratchets current to prev" $ withSmpServer t $ runTestCfg2 agentCfg agentCfgRatchetVPrev 1 $ runTest PQSupportOff False
it "ratchet current" $ withSmpServer t $ runTestCfg2 agentCfg agentCfg 1 $ runTest PQSupportOn False
it "ratchet prev" $ withSmpServer t $ runTestCfg2 agentCfgRatchetVPrev agentCfgRatchetVPrev 1 $ runTest PQSupportOff False
it "ratchets prev to current" $ withSmpServer t $ runTestCfg2 agentCfgRatchetVPrev agentCfg 1 $ runTest PQSupportOff False
it "ratchets current to prev" $ withSmpServer t $ runTestCfg2 agentCfg agentCfgRatchetVPrev 1 $ runTest PQSupportOff False
testServerMatrix2 :: HasCallStack => ATransport -> (InitialAgentServers -> IO ()) -> Spec
testServerMatrix2 t runTest = do
@@ -911,6 +911,7 @@ testAllowConnectionClientRestart t = do
threadDelay 100000 -- give time to enqueue confirmation (enqueueConfirmation)
disposeAgentClient alice
threadDelay 250000
alice2 <- getSMPAgentClient' 3 agentCfg initAgentServers testDB
@@ -1947,7 +1948,7 @@ testWaitDeliveryNoPending t = withAgentClients2 $ \alice bob ->
liftIO $ noMessages alice "nothing else should be delivered to alice"
liftIO $ noMessages bob "nothing else should be delivered to bob"
where
baseId = 3
baseId = 1
msgId = subtract baseId
testWaitDelivery :: ATransport -> IO ()
@@ -2001,7 +2002,7 @@ testWaitDelivery t =
liftIO $ noMessages alice "nothing else should be delivered to alice"
liftIO $ noMessages bob "nothing else should be delivered to bob"
where
baseId = 3
baseId = 1
msgId = subtract baseId
testWaitDeliveryAUTHErr :: ATransport -> IO ()
@@ -2044,7 +2045,7 @@ testWaitDeliveryAUTHErr t =
liftIO $ noMessages alice "nothing else should be delivered to alice"
liftIO $ noMessages bob "nothing else should be delivered to bob"
where
baseId = 3
baseId = 1
msgId = subtract baseId
testWaitDeliveryTimeout :: ATransport -> IO ()
@@ -2084,7 +2085,7 @@ testWaitDeliveryTimeout t =
liftIO $ noMessages alice "nothing else should be delivered to alice"
liftIO $ noMessages bob "nothing else should be delivered to bob"
where
baseId = 3
baseId = 1
msgId = subtract baseId
testWaitDeliveryTimeout2 :: ATransport -> IO ()
@@ -2130,7 +2131,7 @@ testWaitDeliveryTimeout2 t =
liftIO $ noMessages alice "nothing else should be delivered to alice"
liftIO $ noMessages bob "nothing else should be delivered to bob"
where
baseId = 3
baseId = 1
msgId = subtract baseId
testJoinConnectionAsyncReplyErrorV8 :: HasCallStack => ATransport -> IO ()
@@ -3087,7 +3088,7 @@ exchangeGreetings :: HasCallStack => AgentClient -> ConnId -> AgentClient -> Con
exchangeGreetings = exchangeGreetings_ PQEncOn
exchangeGreetings_ :: HasCallStack => PQEncryption -> AgentClient -> ConnId -> AgentClient -> ConnId -> ExceptT AgentErrorType IO ()
exchangeGreetings_ pqEnc = exchangeGreetingsMsgId_ pqEnc 4
exchangeGreetings_ pqEnc = exchangeGreetingsMsgId_ pqEnc 2
exchangeGreetingsMsgId :: HasCallStack => Int64 -> AgentClient -> ConnId -> AgentClient -> ConnId -> ExceptT AgentErrorType IO ()
exchangeGreetingsMsgId = exchangeGreetingsMsgId_ PQEncOn

View File

@@ -105,7 +105,7 @@ notificationTests t = do
describe "Managing notification subscriptions" $ do
describe "should create notification subscription for existing connection" $
testNtfMatrix t testNotificationSubscriptionExistingConnection
xdescribe "should create notification subscription for new connection" $
describe "should create notification subscription for new connection" $
testNtfMatrix t testNotificationSubscriptionNewConnection
it "should change notifications mode" $
withSmpServer t $
@@ -116,19 +116,19 @@ notificationTests t = do
withAPNSMockServer $ \apns ->
withNtfServer t $ testChangeToken apns
describe "Notifications server store log" $
xit "should save and restore tokens and subscriptions" $
it "should save and restore tokens and subscriptions" $
withSmpServer t $
withAPNSMockServer $ \apns ->
testNotificationsStoreLog t apns
describe "Notifications after SMP server restart" $
xit "should resume subscriptions after SMP server is restarted" $
it "should resume subscriptions after SMP server is restarted" $
withAPNSMockServer $ \apns ->
withNtfServer t $ testNotificationsSMPRestart t apns
describe "Notifications after SMP server restart" $
it "should resume batched subscriptions after SMP server is restarted" $
withAPNSMockServer $ \apns ->
withNtfServer t $ testNotificationsSMPRestartBatch 100 t apns
xdescribe "should switch notifications to the new queue" $
describe "should switch notifications to the new queue" $
testServerMatrix2 t $ \servers ->
withAPNSMockServer $ \apns ->
withNtfServer t $ testSwitchNotifications servers apns
@@ -146,7 +146,7 @@ notificationTests t = do
testNtfMatrix :: HasCallStack => ATransport -> (APNSMockServer -> AgentMsgId -> AgentClient -> AgentClient -> IO ()) -> Spec
testNtfMatrix t runTest = do
describe "next and current" $ do
xit "curr servers; curr clients" $ runNtfTestCfg t 1 cfg ntfServerCfg agentCfg agentCfg runTest
it "curr servers; curr clients" $ runNtfTestCfg t 1 cfg ntfServerCfg agentCfg agentCfg runTest
it "curr servers; prev clients" $ runNtfTestCfg t 3 cfg ntfServerCfg agentCfgVPrevPQ agentCfgVPrevPQ runTest
it "prev servers; prev clients" $ runNtfTestCfg t 3 cfgVPrev ntfServerCfgVPrev agentCfgVPrevPQ agentCfgVPrevPQ runTest
it "prev servers; curr clients" $ runNtfTestCfg t 3 cfgVPrev ntfServerCfgVPrev agentCfg agentCfg runTest
@@ -374,20 +374,20 @@ testNotificationSubscriptionExistingConnection APNSMockServer {apnsQ} baseId ali
-- alice client already has subscription for the connection
Left (CMD PROHIBITED _) <- runExceptT $ getNotificationMessage alice nonce message
threadDelay 200000
threadDelay 300000
suspendAgent alice 0
closeSQLiteStore store
threadDelay 200000
threadDelay 300000
-- aliceNtf client doesn't have subscription and is allowed to get notification message
withAgent 3 aliceCfg initAgentServers testDB $ \aliceNtf -> runRight_ $ do
(_, [SMPMsgMeta {msgFlags = MsgFlags True}]) <- getNotificationMessage aliceNtf nonce message
pure ()
threadDelay 200000
threadDelay 300000
reopenSQLiteStore store
foregroundAgent alice
threadDelay 200000
threadDelay 300000
runRight_ $ do
get alice =##> \case ("", c, Msg "hello") -> c == bobId; _ -> False
@@ -515,7 +515,7 @@ testChangeNotificationsMode APNSMockServer {apnsQ} =
-- no notifications should follow
noNotification apnsQ
where
baseId = 3
baseId = 1
msgId = subtract baseId
testChangeToken :: APNSMockServer -> IO ()
@@ -554,7 +554,7 @@ testChangeToken APNSMockServer {apnsQ} = withAgent 1 agentCfg initAgentServers t
-- no notifications should follow
noNotification apnsQ
where
baseId = 3
baseId = 1
msgId = subtract baseId
testNotificationsStoreLog :: ATransport -> APNSMockServer -> IO ()

View File

@@ -101,26 +101,26 @@ smpProxyTests = do
it "500x20" . twoServersFirstProxy $ 500 `inParrallel` deliver 20
describe "agent API" $ do
describe "one server" $ do
xit "always via proxy" . oneServer $
it "always via proxy" . oneServer $
agentDeliverMessageViaProxy ([srv1], SPMAlways, True) ([srv1], SPMAlways, True) C.SEd448 "hello 1" "hello 2" 1
xit "without proxy" . oneServer $
it "without proxy" . oneServer $
agentDeliverMessageViaProxy ([srv1], SPMNever, False) ([srv1], SPMNever, False) C.SEd448 "hello 1" "hello 2" 1
describe "two servers" $ do
xit "always via proxy" . twoServers $
it "always via proxy" . twoServers $
agentDeliverMessageViaProxy ([srv1], SPMAlways, True) ([srv2], SPMAlways, True) C.SEd448 "hello 1" "hello 2" 1
xit "both via proxy" . twoServers $
it "both via proxy" . twoServers $
agentDeliverMessageViaProxy ([srv1], SPMUnknown, True) ([srv2], SPMUnknown, True) C.SEd448 "hello 1" "hello 2" 1
xit "first via proxy" . twoServers $
it "first via proxy" . twoServers $
agentDeliverMessageViaProxy ([srv1], SPMUnknown, True) ([srv2], SPMNever, False) C.SEd448 "hello 1" "hello 2" 1
xit "without proxy" . twoServers $
it "without proxy" . twoServers $
agentDeliverMessageViaProxy ([srv1], SPMNever, False) ([srv2], SPMNever, False) C.SEd448 "hello 1" "hello 2" 1
xit "first via proxy for unknown" . twoServers $
it "first via proxy for unknown" . twoServers $
agentDeliverMessageViaProxy ([srv1], SPMUnknown, True) ([srv1, srv2], SPMUnknown, False) C.SEd448 "hello 1" "hello 2" 1
it "without proxy with fallback" . twoServers_ proxyCfg cfgV7 $
agentDeliverMessageViaProxy ([srv1], SPMUnknown, False) ([srv2], SPMUnknown, False) C.SEd448 "hello 1" "hello 2" 3
it "fails when fallback is prohibited" . twoServers_ proxyCfg cfgV7 $
agentViaProxyVersionError
xit "retries sending when destination or proxy relay is offline" $
it "retries sending when destination or proxy relay is offline" $
agentViaProxyRetryOffline
describe "stress test 1k" $ do
let deliver nAgents nMsgs = agentDeliverMessagesViaProxyConc (replicate nAgents [srv1]) (map bshow [1 :: Int .. nMsgs])
@@ -370,7 +370,7 @@ agentViaProxyRetryOffline = do
a `up` cId = nGet a =##> \case ("", "", UP _ [c]) -> c == cId; _ -> False
a `down` cId = nGet a =##> \case ("", "", DOWN _ [c]) -> c == cId; _ -> False
aCfg = agentCfg {messageRetryInterval = fastMessageRetryInterval}
baseId = 3
baseId = 1
msgId = subtract baseId . fst
servers srv = (initAgentServersProxy SPMAlways SPFProhibit) {smp = userServers $ L.map noAuthSrv [srv]}