newTestServer creates a passive server that never calls processOnce on its own.
( t *testing.T, db database.Store, ps dbpubsub.Pubsub, replicaID uuid.UUID, )
| 5789 | // newTestServer creates a passive server that never calls |
| 5790 | // processOnce on its own. |
| 5791 | func newTestServer( |
| 5792 | t *testing.T, |
| 5793 | db database.Store, |
| 5794 | ps dbpubsub.Pubsub, |
| 5795 | replicaID uuid.UUID, |
| 5796 | ) *chatd.Server { |
| 5797 | t.Helper() |
| 5798 | |
| 5799 | logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) |
| 5800 | server := chatd.New(chatd.Config{ |
| 5801 | Logger: logger, |
| 5802 | Database: db, |
| 5803 | ReplicaID: replicaID, |
| 5804 | Pubsub: ps, |
| 5805 | PendingChatAcquireInterval: testutil.WaitLong, |
| 5806 | }) |
| 5807 | t.Cleanup(func() { |
| 5808 | require.NoError(t, server.Close()) |
| 5809 | }) |
| 5810 | return server |
| 5811 | } |
| 5812 | |
| 5813 | func TestPassiveServerDoesNotProcess(t *testing.T) { |
| 5814 | t.Parallel() |
no test coverage detected