mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpilib] Wait 0.5s after enabling interrupt in tests (#6891)
If the interrupt edge tests are running while under heavy CPU load (like building wpilib) they are prone to failure since the interrupt thread doesn't have enough time to set up callbacks. The interrupt edge tests now copy the original AsynchronousInterrupt test, which has a 0.5s delay after the interrupt is enabled. Running the new interrupt tests while building allwpilib causes far less failures than the old tests.
This commit is contained in:
@@ -62,9 +62,8 @@ class InterruptTest {
|
||||
interrupt.setInterruptEdges(true, true);
|
||||
DIOSim digitalSim = new DIOSim(di);
|
||||
digitalSim.setValue(false);
|
||||
Timer.delay(0.5);
|
||||
interrupt.enable();
|
||||
Timer.delay(0.02);
|
||||
Timer.delay(0.5);
|
||||
digitalSim.setValue(true);
|
||||
Timer.delay(0.02);
|
||||
|
||||
@@ -99,9 +98,8 @@ class InterruptTest {
|
||||
interrupt.setInterruptEdges(true, true);
|
||||
DIOSim digitalSim = new DIOSim(di);
|
||||
digitalSim.setValue(true);
|
||||
Timer.delay(0.5);
|
||||
interrupt.enable();
|
||||
Timer.delay(0.02);
|
||||
Timer.delay(0.5);
|
||||
digitalSim.setValue(false);
|
||||
Timer.delay(0.02);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user