Fix bounce camera acceptance test with unrealistic speed #44

Closed
opened 2026-03-19 10:26:04 +00:00 by david · 1 comment
Owner

Problem

The bounce camera acceptance test (tests/test_camera_acceptance.py::TestBounceCamera::test_bounce_camera_reverses_at_edges) fails because it uses speed=5.0 which causes the camera to move 300 pixels per frame (since 60fps * 5 = 300). This makes the camera bounce every frame because it immediately exceeds the viewport boundaries.

Expected vs Actual

After 51 frames, test expects camera to be at max_x but it ends at 0 because:

  • The bounce direction state is not reset when camera.reset() is called
  • The unrealistic speed causes continuous bouncing within a single frame

Proposed Solutions

Either:

  1. Reduce test speed to a more realistic value (< 1.0) that doesn't cause immediate bouncing
  2. Fix camera.reset() to also reset bounce direction state
  3. Adjust test expectations to account for actual behavior
  • tests/test_camera_acceptance.py
  • engine/camera.py

Test Status

One of 2 failing acceptance tests blocking full test suite pass.


Part of larger effort: Complete pipeline demo and acceptance tests (current status: 671/673 passing)

## Problem The bounce camera acceptance test (`tests/test_camera_acceptance.py::TestBounceCamera::test_bounce_camera_reverses_at_edges`) fails because it uses `speed=5.0` which causes the camera to move 300 pixels per frame (since 60fps * 5 = 300). This makes the camera bounce every frame because it immediately exceeds the viewport boundaries. ## Expected vs Actual After 51 frames, test expects camera to be at `max_x` but it ends at 0 because: - The bounce direction state is not reset when `camera.reset()` is called - The unrealistic speed causes continuous bouncing within a single frame ## Proposed Solutions Either: 1. **Reduce test speed** to a more realistic value (< 1.0) that doesn't cause immediate bouncing 2. **Fix camera.reset()** to also reset bounce direction state 3. **Adjust test expectations** to account for actual behavior ## Related Files - `tests/test_camera_acceptance.py` - `engine/camera.py` ## Test Status One of 2 failing acceptance tests blocking full test suite pass. --- Part of larger effort: Complete pipeline demo and acceptance tests (current status: 671/673 passing)
david closed this issue 2026-03-19 10:34:09 +00:00
Author
Owner

Fixed in commit:

  • 0eb5f1d: Reset camera bounce direction state in reset() method

The camera reset() method now properly resets the bounce direction state (_bounce_dx, _bounce_dy) and radial state (_r_float, _theta_float) when called. This ensures that the bounce camera test can reliably predict the camera position after a reset, regardless of previous state.

Fixed in commit: - 0eb5f1d: Reset camera bounce direction state in reset() method The camera reset() method now properly resets the bounce direction state (_bounce_dx, _bounce_dy) and radial state (_r_float, _theta_float) when called. This ensures that the bounce camera test can reliably predict the camera position after a reset, regardless of previous state.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: klubhaus/sideline#44