Repository navigation
fix: three flaky tests: Find's late selection in the long document, tracked typing across a second, the big CSV's time - #59
Open
pierreneter wants to merge 4 commits into
Open
pierreneter wants to merge 4 commits into
pierreneter wants to merge 4 commits into
Conversation
… selected what it found Find scrolls to the match, and selects it a few frames later, once the scroll has come to rest. The test went on as soon as the paragraph was in view: on a busy machine the selection then came after the test's own caret, and the "!" replaced the word, or went by the caret of before and took the view to page 1. The test timed out on its last page (2 of the last 13 runs on CI). It now waits for the selection. With animation frames made 20 to 250 ms late: 8 of 15 runs failed before, 0 of 24 now. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ever the clock says
Every tracked edit is stamped with its own time, to the second, and two
runs join only under the same mark. A word typed across the end of a
second was two insertions ("tea[+m][+s]"), as was every second of typing
in the saved file; e2e/docx-track.spec.ts failed on CI whenever "ms" was
typed across one.
What is typed or struck out right next to a change of the same kind by
the same author now takes that change's mark: one insertion (or deletion)
of when it began, as in Word. A change of another kind, someone else's
change and a move are not gone on with; text taken out of what someone
inserted still carries their insertion.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The 600,000-row CSV takes the engine 4.5 s on CI and more than 5 s on a slower machine, and a test has 5 s by default: there it always timed out, on CI it passed by half a second. The test now has a minute of its own. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
Three tests failed now and then without a change that touched them. Each is found and fixed at the cause.
1.
e2e/plain.spec.ts: the long document's last page (test only)Seen:
waitForFunctiontimed out atplain.spec.ts:69in 2 of 13 CI runs (#57 on Nov 25, #54 on Nov 27), on commits that have nothing to do with it.Cause: Find scrolls to the match and selects it a few frames later, once the scroll has come to rest (
gotoMatch→afterScroll→editor.input.restore). The test went on as soon as the paragraph was in view. When frames come late, that selection lands after the test has put its own caret behindEND_MARKER:!replaces it (the page reads!), or!goes into page 1 and the view follows it.Either way page 200 never reads
END_MARKER!.Fix: the test waits until the match is selected before it closes the Find bar.
Checked: with every animation frame made 20 to 250 ms late, 8 of 15 runs failed before and 0 of 24 with the wait. Not slowed down, it passed before and passes now.
2.
e2e/docx-track.spec.ts: typing with Track changes on (product fix)Seen:
Expected "…tea[+ms][-m]",Received "…tea[+m][+s][-m]"on #55's run.Cause: every tracked edit is stamped with its own time, to the second (
DocxEditor.replace), and two runs join only when their marks are equal.mandstyped across the end of a second were two insertions. Not only in the test: text typed with Track changes on was saved as onew:insper second of typing.Fix: in
trackEdit, what is typed or struck out right next to a change of the same kind by the same author takes that change's mark: one insertion (or deletion), dated when it began, as Word does. Not continued: a change of the other kind, someone else's change, a move. Text taken out of what someone else inserted still carries their insertion.Checked:
test/track.test.ts):tea[+m][+s]before,tea[+ms]now; also Backspace twice, typing before an insertion, next to a deletion, next to someone else's change;3.
test/convert-service.test.ts: the big CSV written to stdout (test only)Seen:
office-convert › to stdout, wholetimed out on the test VM every time, and passed on #56's CI run in 4.49 s.Cause: the 600,000-row CSV takes the engine 4.5 s on CI and 5.3 s on the VM; a test has 5 s by default.
Fix: the test has a minute of its own. It passes on the VM in 6.7 s.
Tests
On the test VM (Bun 1.4.4, Chromium), on
mainwith #54, #57 and #56:bun test1752 pass, 0 fail;e2e/docx-track.spec.ts2 of 2;e2e/plain.spec.ts4 of 4, three times;bun run typecheckclean.Not in here
test/convert-service.test.tsalso lean on the same CSV taking longer than a fixed time (1.5 s, 100 ms). They have not failed; they would on a much faster machine.🤖 Generated with Claude Code