Stabilize diff pipeline TUI test#13684
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Description
Stabilizes
diff_pipeline_computes_added_lines_and_ghost_blocksfrom the required pre-fix baseline (453f4d30ca962406d7ac6004fa50cd4c879c51e3).Root cause
The test started two asynchronous diff generations back-to-back:
reset_contentemitsContentChangedand computes an empty diff because the reset content matches the new base.apply_diffsimmediately computes the intended replacement diff.The test's one-shot subscription accepted the first
DiffUpdatedwithout identifying which generation completed. Background completion order can vary, and diff results are written without a version guard, so the empty reset result can be observed first or overwrite the edited result. The test then calledexpand_diffsand allowed only 100 scheduler yields for the downstream temporary-block layout. That bounded polling is also not a completion barrier: under scheduling variance, the intended diff and its ghost-layout action may not settle within 100 yields. The baseline reproduced withghosts.len() == 0on run 59 of a tight loop.Fix
LayoutInvalidatednotifications plus a check of the actual ghost state.This continues to exercise the real asynchronous diff and char-cell layout pipeline while synchronizing on the relevant generation and observable render state.
Linked Issue
No linked issue; this addresses the reported flaky Rust test.
ready-to-specorready-to-implement.Testing
cargo test -p warp_tui diff_pipeline_computes_added_lines_and_ghost_blocks -- --nocaptureCompiled exact test binary in a 1,000-run loop: 1,000/1,000 passed (baseline failed on run 59)
cargo test -p warp_tui --lib(102 passed)cargo fmt --all -- --checkcargo clippy -p warp_tui --tests -- -D warningsI have manually tested my changes locally with
./script/run(not applicable: test-only change)Agent Mode
CHANGELOG-NONE
Co-Authored-By: Oz oz-agent@warp.dev
Conversation: https://staging.warp.dev/conversation/7cd7c094-1988-4dfd-bc65-e2f07d3e9c02
Run: https://oz.staging.warp.dev/runs/019f5d5a-e94e-76c2-944b-629b37da970d
Plans:
This PR was generated with Oz.