Skip to content

Commit a33b05b

Browse files
CHANGE: Increase timeouts in UI tests CI instabilities (#2198)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9cc79d7 commit a33b05b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override IEnumerator UnitySetup()
4545

4646
#region Helper methods
4747

48-
IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = 5.0)
48+
IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = kDefaultTimeoutSecs)
4949
{
5050
return WaitUntil(() =>
5151
{
@@ -58,7 +58,7 @@ IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs
5858
}, $"WaitForActionMapRename {index} {isActive}", timeoutSecs);
5959
}
6060

61-
IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 5.0)
61+
IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = kDefaultTimeoutSecs)
6262
{
6363
return WaitUntil(() =>
6464
{
@@ -208,10 +208,8 @@ public IEnumerator CanRenameAction()
208208
// Re-fetch the actions since the UI may have refreshed.
209209
actionItem = actionContainer.Query<InputActionsTreeViewItem>().ToList();
210210

211-
// Click twice to start the rename
212211
SimulateClickOn(actionItem[1]);
213212
yield return WaitForNotDirty();
214-
215213
// If the item is already focused, don't click again
216214
if (!actionItem[1].IsFocused)
217215
{

Assets/Tests/InputSystem.Editor/UIToolkitBaseTestWindow.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
public class UIToolkitBaseTestWindow<T> where T : EditorWindow
1616
{
1717
protected T m_Window;
18+
protected const double kDefaultTimeoutSecs = 10.0;
1819

1920
#region setup and teardown
2021
[OneTimeSetUp]
@@ -124,7 +125,7 @@ protected void SimulateDeleteCommand()
124125
/// Wait for UI toolkit scheduler to process the frame
125126
/// </summary>
126127
/// <param name="timeoutSecs">Maximum time to wait in seconds.</param>
127-
protected IEnumerator WaitForSchedulerLoop(double timeoutSecs = 5.0)
128+
protected IEnumerator WaitForSchedulerLoop(double timeoutSecs = kDefaultTimeoutSecs)
128129
{
129130
bool done = false;
130131
m_Window.rootVisualElement.schedule.Execute(() => done = true);
@@ -136,7 +137,7 @@ protected IEnumerator WaitForSchedulerLoop(double timeoutSecs = 5.0)
136137
/// </summary>
137138
/// <param name="ve">VisualElement to be focused</param>
138139
/// <param name="timeoutSecs">Maximum time to wait in seconds.</param>
139-
protected IEnumerator WaitForFocus(VisualElement ve, double timeoutSecs = 5.0)
140+
protected IEnumerator WaitForFocus(VisualElement ve, double timeoutSecs = kDefaultTimeoutSecs)
140141
{
141142
return WaitUntil(() => ve.focusController.focusedElement == ve, "WaitForFocus", timeoutSecs);
142143
}
@@ -145,7 +146,7 @@ protected IEnumerator WaitForFocus(VisualElement ve, double timeoutSecs = 5.0)
145146
/// Wait for the windows to be not dirty
146147
/// </summary>
147148
/// <param name="timeoutSecs">Maximum time to wait in seconds.</param>
148-
protected IEnumerator WaitForNotDirty(double timeoutSecs = 5.0)
149+
protected IEnumerator WaitForNotDirty(double timeoutSecs = kDefaultTimeoutSecs)
149150
{
150151
return WaitUntil(() => m_Window.rootVisualElement.panel.isDirty == false, "WaitForNotDirty", timeoutSecs);
151152
}
@@ -156,7 +157,7 @@ protected IEnumerator WaitForNotDirty(double timeoutSecs = 5.0)
156157
/// <param name="action">Lambda to call between frame</param>
157158
/// <param name="assertMessage">Assert Message</param>
158159
/// <param name="timeoutSecs">Maximum time to wait in seconds.</param>
159-
protected IEnumerator WaitUntil(Func<bool> action, string assertMessage, double timeoutSecs = 5.0)
160+
protected IEnumerator WaitUntil(Func<bool> action, string assertMessage, double timeoutSecs = kDefaultTimeoutSecs)
160161
{
161162
var endTime = EditorApplication.timeSinceStartup + timeoutSecs;
162163
do

0 commit comments

Comments
 (0)