Repository navigation
Run response-dependent scenarios with every answer timing - #120
Merged
Merged
Conversation
Scenarios that wait on an answer of the server or the application run with that answer at once, on the next macrotask, after 400 ms and as an error: REST and muxws calls, repeats, the attempt timeout, call liveness, the schema check, defaultSort(), lookupChoices, watch() with fetch over a fake and a polling event client, file downloads, peer sources and reconnects. The demo's REST paths (first page, save, watch() read of a changed record) run the same timings in e2e.
✅ Incremental coverage — nothing to gradeNo executable lines were changed between 3 files not graded (3 ignored by pattern)
Coverage reports: coverage.json (coverage.py, 76 files) · coverage/clover.xml (clover, 18 files) — incremental-coverage-check v3.1.0 |
The call now loses its first attempt after its repeat window; only the hold sends the repeat, whose answer arrives at each timing. Before, the call settled with its first answer and passed without the hold.
A rejection after DELAYED_MS joins the timings: an error that arrives after animations, debounces and later answers, e.g. a failed record read of watch() behind a successful one.
Over muxws every server frame reaches the page at the timing, in order: the first page, the favorite save and the other tab's change. Over REST a 500 after DELAYED_MS joins the timings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every scenario that depends on an answer of the server or the application now runs with each answer timing: immediate (an already resolved promise; a synchronous thenable where the type takes
PromiseLike), macrotask (setTimeout(0)), delayed (400 ms, longer than Vuetify transitions and the input debounces) rejection (an already rejected promise, or an error status) and delayedRejection (rejected, or an error status, after 400 ms).Test-only: no combination failed, so there is no library change, version bump or changelog entry.
Timing matrix
Columns: timings covered before this PR, then after it. "deferred" means a hand-released promise, which the test resolves at a moment it picks.
retrieve,listCursor) through an axios adapter: answer or 404, call activity, pending callsattemptTimeoutMs, settled by the repeat's answerwaitingliveness signal: first attempt lost after its repeat window, repeat answered/schemaanswersdefaultSort()ViewSetRequestError, stream resetStreamRefusedConnectionLost, or final closewatch()on a muxws ViewSet with a peer sourcelookupChoices: search, ids, empty ids, order of two callslookupChoices(viewset)over RESTwatch()withfetch: true/ aFetchRowsfunction: two events in arrival orderwatch()withfetch: nothing called afterunsubscribe()while a read is pendingwatch()over a polling event client:readyand a later change with its recordFileDownloador the decoded JSON error bodyfetch: trueread of the changed record (failure → resync)The e2e spec intercepts the browser's requests and fulfils them with the backend's own response at the given timing; "rejection" and "delayedRejection" there are a 500 with an
ApiErrorBody, at once or after 400 ms. Over muxws,page.routeWebSocketpasses each server frame to the page at the timing, in arrival order; stream errors over muxws are covered by the unit scenarios.Files
vue/tests/timings.ts: timing helpers (answer,isRejection,syncThenable,timedAxios,TIMINGS,DELAYED_MS).vue/tests/response-timing.spec.ts: the unit scenarios above (168 tests).demo/e2e/timing.spec.ts: the e2e scenarios above (24 per browser).Bugs
None found. Mutation checks: the
watch()step queue replaced by an unordered dispatch fails the ordering cases; awaitingsignal that does not hold the call fails the liveness cases.Changed existing tests
None.
Checks
vitest run vue/tests/response-timing.spec.ts: 168 passed.playwright test timing.spec.tson separate ports, in Chromium and Firefox: 48 passed.npm run lint,npm run build,ruff check,ruff format --check: clean.