Skip to content

Fix the C++ swerve drive tests depending on the test before them - #226

Merged
thenetworkgrinch merged 1 commit into
masterfrom
fix-cpp-swerve-test-state
Oct 20, 2026
Merged

thenetworkgrinch merged 1 commit into
masterfrom
fix-cpp-swerve-test-state

Conversation

@thenetworkgrinch

Copy link
Copy Markdown
Collaborator

The C++ swerve drive tests share one set of simulated TalonFXs, and each test started from whatever the previous test left: wheels turned, motors still running toward the last setpoint. Catch2 runs the tests in a random order, so tests that assume forward-facing, stopped wheels failed depending on the order, as in the master CI run (SetAzimuthAnglesTurnsEveryModuleEvenWithAVelocityDeadband), and earlier LockPoseSetsXPattern, LockPoseTurnsTheWheelsEvenWithAVelocityDeadband and DesiredModuleStatesAreTheOptimizedOnes. DesiredModuleStatesAreTheOptimizedOnes failed every time in declaration order.

The fixture now stops each shared motor, zeroes its simulated velocity, and zeroes its encoder before every test.

Locally, [SwerveDriveTest] passes in declaration order, with the two random seeds that failed before, and with a new random seed. The CI filter [SwerveDriveTest],[SwerveInputStreamTelemetryTest] passes 57/57 three times with every core kept busy.

… before each test, instead of starting from where the last test left them
@thenetworkgrinch
thenetworkgrinch merged commit 4108924 into master Oct 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant