File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ export abstract class PersistentStream<
256
256
// We ignore Promise rejections for cancelled idle checks.
257
257
assert(
258
258
err.code === Code.CANCELLED,
259
- ' Received unexpected error in idle timeout closure.'
259
+ ` Received unexpected error in idle timeout closure. Expected CANCELLED, but was: ${err}`
260
260
);
261
261
});
262
262
}
@@ -293,7 +293,7 @@ export abstract class PersistentStream<
293
293
* </ul>
294
294
*
295
295
* A new stream can be opened by calling `start` unless `finalState` is set to
296
- * `PersistentStreamState.Stoppen `.
296
+ * `PersistentStreamState.Stopped `.
297
297
*
298
298
* @param finalState the intended state of the stream after closing.
299
299
* @param error the error the connection was closed with.
@@ -324,17 +324,15 @@ export abstract class PersistentStream<
324
324
// inhibit backoff or otherwise manipulate the state in its non-started state.
325
325
this.state = finalState;
326
326
327
- // Clean up the underlying stream because we are no longer interested in
328
- // events
327
+ // Clean up the underlying stream because we are no longer interested in events.
329
328
if (this.stream !== null) {
330
329
this.stream.close();
331
330
this.stream = null;
332
331
}
333
332
334
333
const listener = this.listener!;
335
334
336
- // Clear the listener to avoid bleeding of events from the underlying
337
- // streams
335
+ // Clear the listener to avoid bleeding of events from the underlying streams.
338
336
this.listener = null;
339
337
340
338
// If the caller explicitly requested a stream stop, don't notify them of a closing stream (it
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ export class AsyncQueue {
24
24
// The last promise in the queue.
25
25
private tail: Promise<AnyJs | void> = Promise.resolve();
26
26
27
- // A map of timeout handles to the respective deferred promises. Contains an
28
- // entry for each operation that is still queued to be run in the future
29
- // (i.e. it has a delay that has not yet elapsed).
27
+ // A map of timeout handles to their respective deferred promises. Contains an
28
+ // entry for each operation that is still queued to run in the future (i.e. it
29
+ // has a delay that has not yet elapsed).
30
30
private delayedOperations: Map<number, Deferred<any>> = new Map();
31
31
32
32
// visible for testing
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ const IDLE_DISPATCH_DELAY_MS = 60.0 * 1000;
22
22
/** The maximum delay we use in a test run. */
23
23
const TEST_DISPATCH_DELAY_MS = 1.0 * 1000;
24
24
25
+ /**
26
+ * Dispatch queue used in the integration tests that caps delayed executions at
27
+ * 1.0 seconds.
28
+ */
25
29
export class TestQueue extends AsyncQueue {
26
30
idleTimeoutDeferred: Deferred<void> | null = null;
27
31
You can’t perform that action at this time.
0 commit comments