Skip to content

CHANGE: Increase timeouts in UI tests CI instabilities #2198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 14, 2025
17 changes: 8 additions & 9 deletions Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal class InputActionsEditorTests : UIToolkitBaseTestWindow<InputActionsEdi
{
#region setup and teardown
InputActionAsset m_Asset;
const double kTimeoutSecs = 10.0;

public override void OneTimeSetUp()
{
Expand Down Expand Up @@ -45,7 +46,7 @@ public override IEnumerator UnitySetup()

#region Helper methods

IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = 5.0)
IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = 10.0)
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the kTimeoutSecs constant as the default parameter value (timeoutSecs = kTimeoutSecs) instead of the hard-coded 10.0 to keep timeout values centralized.

Suggested change
IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = 10.0)
IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = kTimeoutSecs)

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you hint at why wouldn't we do that? Seems a reasonable suggestion

{
return WaitUntil(() =>
{
Expand All @@ -58,7 +59,7 @@ IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs
}, $"WaitForActionMapRename {index} {isActive}", timeoutSecs);
}

IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 5.0)
IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 10.0)
{
return WaitUntil(() =>
{
Expand Down Expand Up @@ -127,8 +128,8 @@ public IEnumerator CanRenameActionMap()

// changing the selection triggers a state change, wait for the scheduler to process the frame
yield return WaitForSchedulerLoop();
yield return WaitForNotDirty();
yield return WaitForFocus(m_Window.rootVisualElement.Q("action-maps-list-view"));
yield return WaitForNotDirty(kTimeoutSecs);
yield return WaitForFocus(m_Window.rootVisualElement.Q("action-maps-list-view"), kTimeoutSecs);

// refetch the action map item since the ui may have refreshed.
actionMapItem = actionMapsContainer.Query<InputActionMapsTreeViewItem>().ToList();
Expand Down Expand Up @@ -202,16 +203,14 @@ public IEnumerator CanRenameAction()

// Selection change triggers a state change, wait for the scheduler to process the frame
yield return WaitForSchedulerLoop();
yield return WaitForNotDirty();
yield return WaitForFocus(m_Window.rootVisualElement.Q<TreeView>("actions-tree-view"));
yield return WaitForNotDirty(kTimeoutSecs);
yield return WaitForFocus(m_Window.rootVisualElement.Q<TreeView>("actions-tree-view"), kTimeoutSecs);

// Re-fetch the actions since the UI may have refreshed.
actionItem = actionContainer.Query<InputActionsTreeViewItem>().ToList();

// Click twice to start the rename
SimulateClickOn(actionItem[1]);
yield return WaitForNotDirty();

yield return WaitForNotDirty(kTimeoutSecs);
// If the item is already focused, don't click again
if (!actionItem[1].IsFocused)
{
Expand Down