Files
simplexmq/tests
Evgeny @ SimpleX Chat 71bb0d34a4 smp server: deliver messages sent while the recipient subscribes (#2008)
* tests: reproduce SUB and SEND race in one block

* smp server: move subscriber registration out of serverThread

* smp server: deliver messages sent while the recipient subscribes

* smp server: keep subscriber registration in smpServer, pass it to client

* tests: receive SUB and SEND responses in order

* smp server: register subscription of a new queue directly

* smp server: name server subscribers srvSubs in runClient

* tests: sign SUB with authTransmission, keep test helpers unchanged

* smp server: remove do and mask_ from subscribeNewQueue

* smp server: send the first message once when SEND delivers it during SUB

* smp server: plan with SUB and SEND sequences before and after the change

* smp server: one sequence diagram with added and removed steps in the plan

* smp server: process all subscription changes in the client thread, remove subQ and serverThread

* smp server: send the first message once after SUBS, keep service counts exact

* smp server: name the reader monad in the type of setService

* plans: correct the diagrams and decisions of subscription processing

* plans: diagrams of a duplicate SUB and of SUBS, corrected decisions

* plans: duplicate SUB with SEND, service counts before and after the change

* tests: switch subscription with SUB and SEND in one block

* docs: remove the outdated SMP server design diagram

* smp server: move processClientSub back to the place of serverThread, passed to client threads as a parameter

* smp server: pass the pair of subscription processors to client, applied to the client where called

* smp server: show subscribeQueue and sharedSubscribeQueue as comments at their master places, temporary [skip ci]

* smp server: remove the temporary comments, the tree equals 966701dd [skip ci]

* tests: cover the changed subscription paths with concurrent, blocked, service and notifier scenarios

* tests: cover SMP server subscription changes

* smp server: remove the subscription branch for a disconnected client
2026-11-09 12:41:55 +00:00
..
2026-05-21 14:14:03 +01:00

Running tests with coverage

  1. Uncomment coverage sections in cabal.project file.
  2. Add -fhpc to ghc-options of simplexmq-test in simplexmq.cabal file.
  3. Disable (xit) test "should subscribe to multiple (200) subscriptions with batching", enable (comment skip) the next test instead.
  4. Run cabal test.
  5. Open generated coverage report in the browser.