Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit a91f5a7

Browse files
committed
test: Clean up debug logging, rename SequentialSubscribeResend -> SubscriberResendsSequential.
1 parent 5e765d7 commit a91f5a7

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

test/integration/SubscriberResends.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,22 +202,19 @@ describeRepeats('resends', () => {
202202
})
203203

204204
beforeAll(async () => {
205-
client.debug('BEFORE ALL >')
206205
const results = await publishTestMessages.raw(MAX_MESSAGES, {
207206
waitForLast: true,
208207
timestamp: 111111,
209208
})
210209
published = results.map(([msg]: any) => msg)
211210
publishedRequests = results.map(([, req]: any) => req)
212-
client.debug('BEFORE ALL <')
213211
}, WAIT_FOR_STORAGE_TIMEOUT * 2)
214212

215213
beforeEach(async () => {
216214
await client.connect()
217215
// ensure last message is in storage
218216
const lastRequest = publishedRequests[publishedRequests.length - 1]
219217
await waitForStorage(lastRequest)
220-
client.debug('was stored', lastRequest)
221218
}, WAIT_FOR_STORAGE_TIMEOUT * 2)
222219

223220
it('requests resend', async () => {
@@ -304,7 +301,6 @@ describeRepeats('resends', () => {
304301

305302
describe('resendSubscribe', () => {
306303
it('sees resends and realtime', async () => {
307-
client.debug('sees resends and realtime >')
308304
const sub = await subscriber.resendSubscribe({
309305
streamId: stream.id,
310306
last: published.length,
@@ -346,11 +342,9 @@ describeRepeats('resends', () => {
346342
expect(sub.realtime.isWritable()).toBe(false)
347343
expect(sub.resend.isReadable()).toBe(false)
348344
expect(sub.resend.isWritable()).toBe(false)
349-
client.debug('sees resends and realtime <')
350345
})
351346

352347
it('sees resends when no realtime', async () => {
353-
client.debug('sees resends when no realtime >')
354348
const sub = await subscriber.resendSubscribe({
355349
streamId: stream.id,
356350
last: published.length,
@@ -380,7 +374,6 @@ describeRepeats('resends', () => {
380374
expect(sub.realtime.isWritable()).toBe(false)
381375
expect(sub.resend.isReadable()).toBe(false)
382376
expect(sub.resend.isWritable()).toBe(false)
383-
client.debug('sees resends when no realtime <')
384377
})
385378

386379
it('ends resend if unsubscribed', async () => {

test/integration/SequentialSubscribeResend.test.ts renamed to test/integration/SubscriberResendsSequential.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ describeRepeats('sequential resend subscribe', () => {
5959
subscriber = client.subscriber
6060

6161
// eslint-disable-next-line require-atomic-updates
62-
client.debug('connecting before test >>')
6362
await Promise.all([
6463
client.connect(),
6564
client.session.getSessionToken(),
@@ -68,7 +67,6 @@ describeRepeats('sequential resend subscribe', () => {
6867
name: uid('stream')
6968
})
7069
await stream.addToStorageNode(config.clientOptions.storageNode.address)
71-
client.debug('connecting before test <<')
7270

7371
publishTestMessages = getPublishTestMessages(client, {
7472
stream,
@@ -102,7 +100,6 @@ describeRepeats('sequential resend subscribe', () => {
102100
// ensure last message is in storage
103101
const lastRequest = publishedRequests[publishedRequests.length - 1]
104102
await waitForStorage(lastRequest)
105-
client.debug('was stored', lastRequest)
106103
})
107104

108105
afterEach(async () => {
@@ -136,8 +133,6 @@ describeRepeats('sequential resend subscribe', () => {
136133
const id = (i + 2) * 111111 // start at 222222
137134
// eslint-disable-next-line no-loop-func
138135
test(`test ${id}`, async () => {
139-
const debug = client.debug.extend(`check ${id}`)
140-
debug('check >')
141136
const sub = await subscriber.resendSubscribe({
142137
streamId: stream.id,
143138
last: published.length,
@@ -148,24 +143,19 @@ describeRepeats('sequential resend subscribe', () => {
148143

149144
const message = Msg()
150145
// eslint-disable-next-line no-await-in-loop
151-
debug('PUBLISH >')
152146
const req = await client.publish(stream.id, message, id) // should be realtime
153-
debug('PUBLISH <')
154147
// keep track of published messages so we can check they are resent in next test(s)
155148
published.push(message)
156149
publishedRequests.push(req)
157-
debug('COLLECT >')
158150
const receivedMsgs = await collect(sub, async ({ received }) => {
159151
if (received.length === published.length) {
160152
await sub.return()
161153
}
162154
})
163-
debug('COLLECT <')
164155

165156
const msgs = receivedMsgs
166157
expect(msgs).toHaveLength(published.length)
167158
expect(msgs).toEqual(published)
168-
client.debug('check <')
169159
})
170160
}
171161
})

0 commit comments

Comments
 (0)