DeepBlueRobotics / DeepBlueSim

MIT License
8 stars 0 forks source link

`testShaftRotatesInAutonomous` fails occasionally #94

Closed brettle closed 2 months ago

brettle commented 3 months ago

It just succeeded on my local machine 17 times in a row and then failed with:

org.opentest4j.AssertionFailedError: Shaft close to target rotation ==> expected: <160.0> but was: <95.42188982042626>
    at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
    at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
    at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
    at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1020)
    at app//frc.robot.PWMMotorControllerTest.lambda$testShaftRotatesInAutonomous$1(PWMMotorControllerTest.java:31)
    at app//org.carlmontrobotics.libdeepbluesim.WebotsSimulator.runAllCallbacks(WebotsSimulator.java:467)
    at app//org.carlmontrobotics.libdeepbluesim.WebotsSimulator.lambda$waitForUserToStart$6(WebotsSimulator.java:377)
    at java.base@17.0.8.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base@17.0.8.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base@17.0.8.1/java.lang.Thread.run(Thread.java:833)

Might just need to increase the tolerance.

brettle commented 3 months ago

This is probably best worked on after #88.

brettle commented 2 months ago

Will probably be fixed by a fix to #101.

brettle commented 2 months ago

Should be addressed by PR #114. Reopen if another assertion failure is seen.