Skip to content

Commit

Permalink
Remove workarounds for chromium bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
martenrichter committed Sep 16, 2023
1 parent 066018a commit a081983
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
8 changes: 1 addition & 7 deletions test/bidirectional-streams.spec.js
Expand Up @@ -76,13 +76,7 @@ describe('bidirectional streams', function () {

// redirect input to output
try {
// Correct test
// await bidiStream.readable.pipeTo(bidiStream.writable)
// temporal work around until Chromium is fixed
await Promise.race([
bidiStream.readable.pipeTo(bidiStream.writable),
client.closed
])
await bidiStream.readable.pipeTo(bidiStream.writable)
} catch (error) {
console.log('Pipe to error (ignore)', error) // Actually all you can get is, that the fin is catched
}
Expand Down
10 changes: 2 additions & 8 deletions test/fixtures/write-stream.js
Expand Up @@ -4,10 +4,9 @@
* @template T
* @param {WritableStream<T>} writable
* @param {T[]} input
* @param {any} [closehelper]
* @returns
*/
export async function writeStream(writable, input, closehelper) {
export async function writeStream(writable, input) {
const writer = writable.getWriter()

for (const buf of input) {
Expand All @@ -18,12 +17,7 @@ export async function writeStream(writable, input, closehelper) {
await writer.ready
await writer.releaseLock()
try {
if (!closehelper) {
// correct test
await writable.close()
} else {
await Promise.race([writable.close(), closehelper])
}
await writable.close()
} catch (error) {
console.log('Did we get a STOP_SENDING? ignore', error)
}
Expand Down
4 changes: 1 addition & 3 deletions test/unidirectional-streams.spec.js
Expand Up @@ -43,9 +43,7 @@ describe('unidirectional streams', function () {

const stream = await client.createUnidirectionalStream()
// correct test
// await writeStream(stream, KNOWN_BYTES)
// workaround for Chromium bug
await writeStream(stream, KNOWN_BYTES, client.closed)
await writeStream(stream, KNOWN_BYTES)

// the remote will close the session
const result = await client.closed
Expand Down

0 comments on commit a081983

Please sign in to comment.