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

test: Throttle browser upload speed in testUpload #973

Closed
wants to merge 3 commits into from

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Feb 24, 2025

Most recent Chromium 133's BiDi driver regresses large uploads: They completely clog and eventually crash the BiDi web socket.

Fortunately we can use a CDP command escape hatch to throttle the upload speed [1]. There is no BiDi API for that, so we cannot do the same approach with Firefox -- but that is happy with big uploads, so keep current behaviour there.

[1] https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditions


See #968, this helps. However, locally the test fails/flakes much later on for me (missing "File uploaded" alert), let's get the bots' opinion. Update: Fixed.

Wait until the "project" directory is loaded before trying to drop a
file into it. Otherwise the test sometimes failed because the previous
/home/admin directory already contains a `drag-drop-testfile.txt` which
triggered the replace dialog.
Most recent Chromium 133's BiDi driver regresses large uploads: They
completely clog and eventually crash the BiDi web socket.

Fortunately we can use a CDP command escape hatch to throttle the upload
speed [1]. There is no BiDi API for that, so we cannot do the same
approach with Firefox -- but that is happy with big uploads, so keep
current behaviour there.

[1] https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditions
@martinpitt
Copy link
Member Author

martinpitt commented Feb 24, 2025

Hmm, I don't get this failure locally. Looks like the upload is way too fast, i.e. the throttling isn't effective. However, I only tested it on the new container, not the previous one. Comparing with #968

I can't figure it out locally. Maybe the CDP command fails, which will be fixed by cockpit-project/cockpit#21650 . Testing with a trace-enabled run now. That's not it, the command succeeds.

@martinpitt
Copy link
Member Author

I can reproduce the failure in the old container with chromium 132. Apparently the throttling just doesn't work there. So I'll just merge this into #968.

@martinpitt martinpitt closed this Feb 24, 2025
@martinpitt martinpitt deleted the chromium-upload branch February 24, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant