Skip to content

Seven macOS browser tests: an acked thread stays pending in the tab, so readThreads lacks it and z sends no undo #5941

Closed

Description

@leaf-agent

In the test-macos job of scheduled run 43412323289 (a9e4d3e99), seven browser tests fail the same way: the server has acknowledged a thread the tab started, but the tab's thread collection still holds only the tab's pending copy. The server's thread never replaces it. Each of the seven passed on macOS in the two previous scheduled runs, 43204020539 (e5559a2b6) and 43007021682, and passed in this run's Linux job.

The clearest diagnostic. test_render_application_boundary.py::test_package_thread_widgets_keep_local_filters_and_independent_subscriptions sends a thread inside sending(page, ...), which returns once the send is acked. It then reads the id of the matching thread from a package widget's collection.threads, and gets pending:5df35978d4fc372fa9bdf18432cc4ae8. The panel never shows a thread view with that id, so the test fails at line 1982.

The same state seen from other readers:

  • readThreads().threads has no entry for the server event's id, so open_panel_thread asserts the page holds no thread <id> (tests/browser/threads/__init__.py:83). This fails in:
    • tests/browser/startup/test_projected_data.py::test_a_comment_follows_an_unversioned_derived_datum_by_its_stable_key, after round_trip(page). Its picture shows the comment's margin mark drawn.
    • tests/browser/test_render_aim.py::test_a_detached_selection_still_has_a_live_writable_composer[revision]
    • tests/browser/test_render_aim.py::test_a_native_cross_cell_selection_sends_its_quote_without_claiming_location
  • After a thread is resolved and its resolve is acked, z sends nothing:
    • tests/browser/test_render_floating_panel.py::test_one_field_starts_a_thread_takes_its_reply_and_settles_it reports the page never sent the undo: … sends=3 acked=3 pending=0 asked=1 heard=1 and the counts stay the same for 120 s.
    • tests/browser/test_render_floating_panel.py::test_a_thread_s_keys_answer_in_its_view reports the same with sends=2 acked=2.
  • tests/browser/test_render_outbox.py::test_undo_waits_while_the_candidate_is_applying_then_reads_accepted_truth: the page never sent the withdrawal. The page keeps polling (asked 4→14, heard 3→13) and still sends nothing.

Lead: #5899 (c0ff621c1). Of the 20 commits in e5559a2b6..a9e4d3e99, #5899 is the one that changes how a sent comment and a Resolve are published. It draws them before the server's reading arrives. It also routes derive (framework/application.js) through step(key, make, ...inputs), which hands back its last result whenever its inputs are the same objects as before. It also makes shareFold remember the subtrees it has shared. If one of those steps leaves out an input that changes when the server's reading takes over a pending thread, it would keep serving the pending thread, and that matches every diagnostic above. #5899's description says the server's answer to a send can arrive while the press's task is still running. A different task order on macOS's runner would explain why Linux passes. This is a hypothesis from the diagnostics and the diff. It isn't verified.

Not reproduced on Linux. On main 04f71ad0d, the six non-package tests pass with -n0, and pass again with --cpu-throttle 6. A reproduction probably has to force the order directly: deliver the server's answer to the send, or the server's reading after it, before the press's task ends. A user who hits this would see their sent thread fail to settle, and Undo stop working after a Resolve, so it is a product race rather than test noise.

Cause of a failure tracked in #4225.

Activity

  1. added
    tend-ci-cause
    on Nov 14, 2026
  2. leaf-agent commented on Nov 14, 2026

    @leaf-agent
    CollaboratorAuthor

    Six of the seven failures have a repair open in #5943. The seventh, the outbox test, stays open here. Its cause still needs a macOS reproduction.

    Cause of the six. #5899 made applyState wait for the frame a gesture owes before it adopts the server's reading. So the send's answer, which round_trip/sending wait for, now lands a task before the page holds the server's thread or offers Undo. These tests read that state straight after the trip and got the tab's pending copy. The thread isn't stuck pending, and the step/shareFold caching from the lead isn't involved. On Linux, pressing z right after an acked Resolve is dropped in 6 of 15 runs at #5899, 5 of 15 on main and 0 of 30 at #5899's parent. In each failing run a second z a second later sent the undo. A user who presses z within that gap loses the press. Nothing else is lost.

    #5943 makes the tests wait for the reading: open_panel_thread waits for the thread, the two floating-panel tests use undo(page), and the package test waits for the server's id. The six pass on Linux, but so they did before. The next scheduled test-macos run after it merges is the real check.

    Still open:

    • test_undo_waits_while_the_candidate_is_applying_then_reads_accepted_truth already waits with undo(page). On macOS its page ended at #sug-thistle with the suggestion in view and the status reading "Lost the connection — reconnecting". So that z showed the suggestion and never took it. I can't reproduce it on Linux.
    • On macOS, test_a_comment_follows_an_unversioned_derived_datum_by_its_stable_key had several more steps between the trip and the read than one frame should need. If the next run still shows the server's thread missing after test: wait for the server's reading of a send before reading what only it decides #5943's waits, the reading was never adopted, not just adopted late. That would point to an owed frame that never paints, leaving afterOwedFrame (browser/runtime/rendering.js) waiting with no fallback. That would be a product bug.

    @max-sixty, assigning you because only test-macos shows the outbox failure and no runner here has macOS. What would settle it is the outbox test run on macOS, or your go-ahead to workflow_dispatch the four-to-five-hour ci run on a branch for it. Otherwise the next scheduled run after #5943 merges is the evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tend-ci-cause

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions