Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPT tests are needed for sendOrder #516

Open
jesup opened this issue May 23, 2023 · 2 comments
Open

WPT tests are needed for sendOrder #516

jesup opened this issue May 23, 2023 · 2 comments

Comments

@jesup
Copy link
Collaborator

jesup commented May 23, 2023

We need WPT tests for sendOrder... but this is hard to do.

The big problem is that to actually test this we need to somehow block transfers temporarily, let data get queued on multiple streams, and then see what order data goes out in after the block is lifted. We might be able to somehow cause enough congestion to let us buffer, but that's hard. Better would be to somehow tell the server to stop reading data for a while, somehow.

@martinthomson
Copy link
Member

Just to expand on the difficulty here, Firefox's stack currently applies backpressure based on flow control, but not congestion. This is a point of contention for us, so we might resolve that, but it highlights potential problems. My preference is that we look at flow control as the basis for this testing, but that means acquiring better control over how the test server (aioquic) operates in some detail. Detail that might fail if they decide to evolve their product.

@jan-ivar
Copy link
Member

jan-ivar commented May 24, 2023

The big problem is that to actually test this we need to somehow block transfers temporarily, let data get queued on multiple streams, and then see what order data goes out in after the block is lifted.

Is the problem how to build up multiple competing queues to dequeue from/roundrobin on? Won't the following do that?

const promises = [];
for (let i = 0; i < 100; i++) {
  promises.push(wt.createUnidirectionalStream({sendOrder: someReshuffledOrder(i)});
}
const streams = await Promise.all(promises);
for (const stream of streams) {
  const writer = writable.getWriter();
  writer.write(bytes).catch(() => {});
  writer.close().catch(() => {});
}

Why do we need to block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants