Skip to content

Commit

Permalink
Increase retries in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
12joan committed May 26, 2024
1 parent 55046f1 commit 14c0767
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
13 changes: 0 additions & 13 deletions Assets/Unity/Prefabs/AsyncTimers.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 4722572164793651410}
- component: {fileID: 7985535929502783101}
m_Layer: 0
m_Name: AsyncTimers
m_TagString: Untagged
Expand All @@ -124,15 +123,3 @@ Transform:
- {fileID: 7401468541887411426}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7985535929502783101
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8890662956768514337}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 06bce02bffdfd4203bd21ac91446d8c3, type: 3}
m_Name:
m_EditorClassIdentifier:
2 changes: 1 addition & 1 deletion Assets/test/Level1.test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Level1Test : ABaseTest {

yield return PressButton("Inspect");

yield return AwaitText("Mentoes Tower brochure", retries: 60);
yield return AwaitText("Mentoes Tower brochure", retries: 120);

yield return PressButton("Cancel");
yield return AwaitPlayingState();
Expand Down
2 changes: 1 addition & 1 deletion Assets/test/Pathfinding.test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PathfindingTest : ABaseTest {

yield return AwaitCondition(
condition: () => agents.transform.childCount == 0,
retries: 30,
retries: 60,
message: "All agents should reach their destination"
);

Expand Down
10 changes: 5 additions & 5 deletions Assets/test/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public abstract class ABaseTest {

protected IEnumerator AwaitCondition(
System.Func<bool> condition,
float retryInterval = 1f,
int retries = 10,
float retryInterval = 0.5f,
int retries = 40,
string message = "AwaitCondition: Timed out"
) {
for (int i = 0; i < retries; i++) {
Expand All @@ -130,7 +130,7 @@ public abstract class ABaseTest {
Assert.Fail(message);
}

protected IEnumerator AwaitSceneChange(string sceneName, float retryInterval = 1f, int retries = 10) {
protected IEnumerator AwaitSceneChange(string sceneName, float retryInterval = 0.5f, int retries = 40) {
yield return AwaitCondition(
condition: () => GetActiveScene() == sceneName,
message: "AwaitSceneChange: Timed out waiting for scene change to " + sceneName,
Expand All @@ -139,7 +139,7 @@ public abstract class ABaseTest {
);
}

protected IEnumerator AwaitText(string text, bool regex = false, float retryInterval = 1f, int retries = 10) {
protected IEnumerator AwaitText(string text, bool regex = false, float retryInterval = 0.5f, int retries = 40) {
yield return AwaitCondition(
condition: () => !!FindByText(text, regex),
message: "AwaitText: Timed out waiting for text: " + text,
Expand Down Expand Up @@ -197,7 +197,7 @@ public abstract class ABaseTest {
}
);

yield return AwaitCondition(condition: () => finished, retries: 60);
yield return AwaitCondition(condition: () => finished, retries: 120);
}

protected IEnumerator ScriptedMovement(string anchorName) {
Expand Down
2 changes: 1 addition & 1 deletion Assets/test/TrainingGameMainMenu.test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TrainingGameMainMenu : ABaseTest {
public IEnumerator StartsMissionTraining() {
Click(GameObject.Find("Mission Training game"));
yield return AwaitSceneChange("Training Game Tower Scene");
yield return AwaitSceneChange("Training Room 1", retries: 30);
yield return AwaitSceneChange("Training Room 1", retries: 60);
}

[UnityTest]
Expand Down

0 comments on commit 14c0767

Please sign in to comment.