Skip to content

Commit

Permalink
fix: Ignore missing coverage for backpressure
Browse files Browse the repository at this point in the history
We don't yet properly test for back pressure. This was only covered
before because a slow state machine in streamx was resulting in
backpressure here, but the fixes in
mafintosh/streamx#77
resulted in no backpressure, so this line became uncovered by tests
  • Loading branch information
gmaclennan committed Jul 6, 2023
1 parent 54a4544 commit b76e54d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/core-index-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ class CoreIndexStream extends Readable {
(await this[kPushEntry](index)) ||
/* istanbul ignore next - TODO: Test when hypercore-next supports a core.clear() method */
didPush
// This is for back-pressure, for which there is not a good test yet.
// The faster streamx state machine in https://github.com/mafintosh/streamx/pull/77
// caused this stream's read buffer to never fill with the current tests,
// so that this line is currently uncovered by tests.
// TODO: Add a test similar to 'Appends from a replicated core are indexed' in core-index-stream.test.js
// but pipe to a slow stream, to test back-pressure, which should result in coverage of this line.
/* istanbul ignore next */
if (!this.#readBufferAvailable) break
}
}
Expand Down

0 comments on commit b76e54d

Please sign in to comment.