Skip to content

stream, test: add tests for 'readable' state machine #8683

Closed
@mcollina

Description

@mcollina

Add test coverage for:

stream._readableState.needReadable
stream._readableState.emittedReadable
stream._readableState.readableListening
stream._readableState.resumeScheduled

this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;

Those govern when and how we need to emit a 'readable' event and resume the flow.
The state machine is definitely complex, feel free to ask questions, and look hard at the source code. We can also add comments on the meaning of all those state variables.

Part of #8644.

cc @Fishrock123

Metadata

Metadata

Assignees

Labels

good first issueIssues that are suitable for first-time contributors.streamIssues and PRs related to the stream subsystem.testIssues and PRs related to the tests.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions