diff options
Diffstat (limited to 'packages/meshbay-hub/tests')
| -rw-r--r-- | packages/meshbay-hub/tests/test_spa_ordering.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_spa_ordering.py b/packages/meshbay-hub/tests/test_spa_ordering.py index 9301fcc..1329b74 100644 --- a/packages/meshbay-hub/tests/test_spa_ordering.py +++ b/packages/meshbay-hub/tests/test_spa_ordering.py @@ -143,3 +143,27 @@ def test_admin_page_does_not_borrow_the_members_panel_state(): for name in ("doInvite", "adminId", "inviteCode", "setInviteUser"): assert name not in admin, \ f"AdminPage references {name}, which only exists in MembersPanel" + + +# ── Upload pipelining ─────────────────────────────────────────────────────── +# +# The upload loop waited for the node to acknowledge each 48 KB chunk before +# reading the next one, which caps throughput at one chunk per round trip no +# matter how much bandwidth there is — and keeps SCTP's congestion window shut, +# so the transport never speeds up either. Measured over a 100 ms path: 0.16 MB/s +# waiting for every ack, 3.47 MB/s with 32 chunks in flight. + +def test_the_uploader_keeps_several_chunks_in_flight(): + src = TRANSPORT.read_text() + body = src[src.index("async uploadFile("):] + body = body[:body.index("\n async ", 1)] + assert "UPLOAD_WINDOW" in body, "the send window is gone — uploads are serial again" + assert "bufferedAmount" in body, ( + "without backpressure the file lands in the send buffer in seconds and " + "the progress bar becomes fiction") + + +def test_no_caller_waits_for_one_chunk_at_a_time(): + app = APP.read_text() + assert "uploadChunk(" not in app, ( + "a per-chunk await is back in the SPA; use transport.uploadFile()") |