Skip to content

flake: Camera2D current undo test still fails after #296 #301

Description

@dsarno

Summary

camera.test_configure_current_sibling_unmark_single_undo is still flaky after #296. PR #300 hit the same Camera2D current-state undo symptom in Godot tests / macOS, even though PR #300 does not touch camera code and the same test matrix passed locally plus on Linux/Windows CI.

This looks like a recurrence of the camera-current race tracked in #140 and #278, which #296 closed by widening the settle window, checking Viewport.get_camera_2d() for Camera2D, and cleaning camera-suite fixtures per test.

New failing example

Failure:

Godot tests: 1043/1060 passed, 1 failed
FAIL: camera.test_configure_current_sibling_unmark_single_undo: After undo second should not be current. viewport_cam=UndoSecond:<Camera2D#1720486792976> first_in_tree=true second_in_tree=true

Why this is probably not PR #300

PR #300 only touches lifecycle reliability code (connection.gd, dispatcher.gd, sessions/registry.py, error-code parity, and related tests). It does not modify camera_handler.gd or test_camera.gd.

Observed signal on the same head SHA:

  • Local script/ci-godot-tests: 1045/1060 passed, 0 failed
  • CI Godot tests / Linux: passed
  • CI Godot tests / Windows: passed
  • CI Godot tests / macOS: failed with the camera undo symptom above

Prior context

This PR #300 failure suggests #296 reduced but did not eliminate the undo-side race.

Suggested investigation

  • Reproduce on macOS headless by looping camera.test_configure_current_sibling_unmark_single_undo against a post-Stabilize camera current-state handling #296 tree.
  • Instrument the undo path around _apply_clear_current, _apply_make_current, _is_current_settled, and the test's post-undo assertion with per-attempt state: first.is_current(), second.is_current(), viewport.get_camera_2d(), and elapsed settle attempts.
  • Check whether the undo action executes clear_current on Second and make_current on First in the expected order, and whether the viewport slot lags even after both bound methods return.
  • Decide whether the production handler needs a stronger post-undo settle path, or whether the test should wait for a deterministic editor/viewport boundary before asserting.
  • Keep this distinct from the separate reload-smoke camera.test_make_current_does_not_cross_classes flake; this occurrence is the sibling undo/current-state test.

Acceptance

  • Root cause or stable mitigation documented for the post-Stabilize camera current-state handling #296 recurrence.
  • The camera suite survives repeated macOS headless CI runs without this failure.
  • If the final answer is an upstream Godot editor/viewport timing bug, file/link the upstream issue and mark any local mitigation as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions