Skip to content

Commit 409b16a

Browse files
authored
fix streams backpressure condition check (#5758)
2 parents e5f54c2 + c24633e commit 409b16a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/workerd/api/streams/standard.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ template <typename Self>
14991499
void WritableImpl<Self>::updateBackpressure(jsg::Lock& js) {
15001500
KJ_ASSERT(isWritable());
15011501
KJ_ASSERT(!isCloseQueuedOrInFlight());
1502-
bool bp = getDesiredSize() < 0;
1502+
bool bp = getDesiredSize() <= 0;
15031503

15041504
if (bp != flags.backpressure) {
15051505
flags.backpressure = bp;

src/wpt/streams-test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ export default {
725725
expectedFailures: [
726726
'start: errors in start cause WritableStream constructor to throw',
727727
'write: returning a rejected promise (second write) should cause writer write() and ready to reject',
728-
'write: returning a promise that becomes rejected after the writer write() should cause writer write() and ready to reject',
729728
],
730729
},
731730
'writable-streams/byte-length-queuing-strategy.any.js': {
@@ -738,7 +737,6 @@ export default {
738737
'writable-streams/close.any.js': {
739738
comment: 'To be investigated',
740739
expectedFailures: [
741-
'when close is called on a WritableStream in waiting state, ready promise should be fulfilled',
742740
'releaseLock() should not change the result of sync close()',
743741
],
744742
},
@@ -791,10 +789,5 @@ export default {
791789
"underlying sink's write or close should not be called if start throws",
792790
],
793791
},
794-
'writable-streams/write.any.js': {
795-
comment: 'To be investigated',
796-
expectedFailures: [
797-
'WritableStream should transition to waiting until write is acknowledged',
798-
],
799-
},
792+
'writable-streams/write.any.js': {},
800793
} satisfies TestRunnerConfig;

0 commit comments

Comments
 (0)