Skip to content

Commit

Permalink
Fix sporadically failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shaynie committed Apr 6, 2023
1 parent 46d71ba commit ec40f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions com.microsoft.mrtk.input/Tests/Runtime/BasicInputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ public IEnumerator InteractableDisabledDuringInteraction()
yield return rightHand.Show(InputTestUtilities.InFrontOfUser());

yield return rightHand.MoveTo(cube.transform.position);
yield return RuntimeTestUtilities.WaitForUpdates();
yield return rightHand.SetHandshape(HandshapeId.Pinch);
yield return RuntimeTestUtilities.WaitForUpdates();

Expand Down Expand Up @@ -515,6 +516,7 @@ public IEnumerator UntrackedControllerNearInteractions()

// First ensure that the interactor can interact with a cube normally
yield return rightHand.MoveTo(cube.transform.position);
yield return RuntimeTestUtilities.WaitForUpdates();
yield return rightHand.SetHandshape(HandshapeId.Pinch);
yield return RuntimeTestUtilities.WaitForUpdates();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public IEnumerator TestAssembleTouchNoSnapSlider()
Assert.AreEqual(0.5f, slider.Value, "Slider shouldn't have snapped to the finger point when SnapToPosition = false");

yield return rightHand.MoveTo(Vector3.zero, 60);
yield return RuntimeTestUtilities.WaitForUpdates();

Vector3 middlePoint = Vector3.Lerp(slider.SliderStart.position, slider.SliderEnd.position, 0.5f);
yield return rightHand.MoveTo(middlePoint, 60);
Expand All @@ -379,7 +380,7 @@ public IEnumerator TestAssembleTouchNoSnapSlider()
interactionUpdated = false;

yield return rightHand.MoveTo(firstPoint, 60);
yield return RuntimeTestUtilities.WaitForUpdates();
yield return RuntimeTestUtilities.WaitForFixedUpdates(frameCount:40);

Assert.IsTrue(slider.IsPokeSelected, "Slider should still be poked.");
Assert.IsTrue(interactionUpdated, "Slider didn't invoke OnValueUpdated when we dragged the handle");
Expand Down

0 comments on commit ec40f31

Please sign in to comment.