Skip to content

warp_editor: 8 render::tests fail when the full crate test suite runs together; each passes in isolation #13853

Closed

Description

@fbartho

Summary

Running the full warp_editor test suite on a clean master checkout (a50b9dd04) consistently fails the same 8 tests in render::tests. Each of them passes when run individually or as a filtered group — they only fail when the whole suite runs together, which points at cross-test state leakage (some shared/global state mutated by earlier tests) rather than a defect in the tests themselves.

Failing tests

render::tests::test_convert_first_line
render::tests::test_edit_after_style
render::tests::test_edit_at_horizontal_rule_end
render::tests::test_edit_many_lines
render::tests::test_enter_after_horizontal_rule
render::tests::test_enter_before_horizontal_rule
render::tests::test_simple_edit
render::tests::test_undo_at_block_boundary

Reproduction

cargo test -p warp_editor                                  # 470 passed, 8 failed
cargo test -p warp_editor render::tests::test_simple_edit  # passes

Result on pristine origin/master (a50b9dd04, detached worktree, no local changes): 470 passed / 8 failed — identical failure set across repeated runs.

Environment

  • macOS 27.0, Apple Silicon (arm64)
  • Rust 1.92.0 (repo rust-toolchain.toml)
  • Xcode 27 beta 3, Metal Toolchain 27A5218h (required to build warpui shaders). I can't fully rule out a beta-toolchain interaction, but the deterministic, order-dependent nature (same 8 tests, pass-in-isolation) reads like state leakage.

Context

Found while validating an unrelated markdown_parser change (#13732): the same 8 failures appear with and without that branch's commits, so I baselined against pristine master to confirm they're pre-existing.

Activity

  1. warp-for-oss commented on Jul 16, 2026

    @warp-for-oss
    Contributor

    @fbartho

    Here's what I found while triaging this issue:

    This looks actionable as a test-isolation bug: the exact failing set matches the render tests that initialize logging in a way that can collide with logging already initialized by another test. It does not appear tied to your unrelated markdown parser branch.

    Maintainer details

    I concluded that the full-suite-only warp_editor render failures are most likely caused by process-global test logger initialization colliding with the render tests' logging helper..

    Triage summary

    This looks like a warp_editor unit-test isolation bug, not a regression from #13732. The reported failure set exactly matches the eight render::tests that call the render test logging helper before running their App::test body.

    Evidence

    • The affected tests in crates/editor/src/render/mod_tests.rs all call init_logging() at the start.
    • That helper is defined in crates/editor/src/render/model/test_utils.rs and calls env_logger::builder().parse_filters("warp_editor=trace").is_test(true).init() behind a helper-local Once.
    • env_logger::init() installs a process-global logger and errors/panics once another test has already initialized logging. This crate also has a separate helper in crates/editor/src/content/find_tests.rs that uses try_init(), which supports the full-suite-only order-dependency shape.
    • That explains why the same tests pass when run alone or as a filtered group but fail when the entire crate suite runs first/alongside them.

    Suggested next step

    Change the render test logging helper to tolerate an already-initialized logger, such as by using try_init() and ignoring the SetLoggerError, or centralize test logging setup. Then rerun cargo test -p warp_editor to confirm the full crate suite is stable.

    No likely duplicates were found among open issues or recently closed issues searched for this failure pattern.

    This is my automated analysis and may be incorrect. A maintainer will verify the details.

    Powered by Oz

  2. added
    area:editor-notebooks
    bug
    repro:high
    triaged
    on Jul 16, 2026
  3. bnavetta commented on Jul 17, 2026

    @bnavetta
    Contributor

    I expect our CI doesn't flag this because we use cargo nextest exclusively

  4. removed their assignment
    on Jul 17, 2026
  5. added
    ready-to-implement
    on Jul 17, 2026
  6. warp-for-oss commented on Jul 17, 2026

    @warp-for-oss
    Contributor

    This issue has been labeled ready-to-implement and is open for contributions involving code changes. If you'd like to tackle it, feel free to open a pull request against this issue. You can also comment @oz-agent on this issue to have the bot draft an implementation PR automatically.

  7. warp-for-oss commented on Jul 17, 2026

    @warp-for-oss
    Contributor

    @bnavetta

    I'm implementing this issue with no spec context.

    You can view the conversation on Warp.

    I created a new draft implementation PR for this issue.

    Next steps:

    • Review the implementation changes in the PR.
    • Complete any manual verification needed for this issue before merging.

    Powered by Oz

  8. fbartho commented on Jul 17, 2026

    @fbartho
    ContributorAuthor

    Oz's implementation matches the result I got to with Claude on my local machine. Not sure how I can help further at this point!

    @bnavetta -- is there a way for non-maintainers to ask that the PR get formally reviewed/ moved out of draft state?

  9. bnavetta commented on Jul 17, 2026

    @bnavetta
    Contributor

    After Oz review completes, that should generally tag a maintainer - in this case, I think the initial review didn't do that because it was still a draft. Asking a maintainer from the original issue to move the PR out of draft works!

  10. added a commit that references this issue on Jul 17, 2026
    7867010
  11. added a commit that references this issue on Jul 18, 2026
    5241c77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:editor-notebooksbugready-to-implementrepro:hightriagedwarp:auto-triage-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions