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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

jfreire-unity
Copy link
Collaborator

@jfreire-unity jfreire-unity commented Jun 27, 2025

Description

The tests change usually pass within 4.3 seconds. And they also fail frequently on the first time the run so this is an attempt to fix the instability reported internally by the team.

Testing status & QA

Will re-run CI at least 5 times and see if tests pass.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 0
  • Halo Effect: 0

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@codecov-github-com
Copy link

codecov-github-com bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2198      +/-   ##
===========================================
+ Coverage    68.10%   68.11%   +0.01%     
===========================================
  Files          367      367              
  Lines        53610    53610              
===========================================
+ Hits         36513    36519       +6     
+ Misses       17097    17091       -6     
Flag Coverage Δ
mac_2021.3_pkg 5.40% <ø> (ø)
mac_2021.3_project 70.37% <ø> (ø)
mac_2022.3_pkg 5.18% <ø> (ø)
mac_2022.3_project 65.23% <ø> (ø)
mac_6000.0_pkg 5.19% <ø> (ø)
mac_6000.0_project 68.04% <ø> (+0.01%) ⬆️
mac_6000.1_pkg 5.19% <ø> (ø)
mac_6000.1_project 68.03% <ø> (-0.01%) ⬇️
mac_6000.2_pkg 5.19% <ø> (ø)
mac_6000.2_project 68.02% <ø> (ø)
mac_trunk_pkg 5.19% <ø> (ø)
mac_trunk_project 67.80% <ø> (ø)
win_2021.3_pkg 5.41% <ø> (ø)
win_2021.3_project 70.44% <ø> (ø)
win_2022.3_pkg 5.18% <ø> (ø)
win_2022.3_project 65.31% <ø> (ø)
win_6000.0_pkg 5.19% <ø> (ø)
win_6000.0_project 68.11% <ø> (+<0.01%) ⬆️
win_6000.1_pkg 5.19% <ø> (ø)
win_6000.1_project 68.10% <ø> (ø)
win_6000.2_pkg 5.19% <ø> (ø)
win_6000.2_project 68.10% <ø> (ø)
win_trunk_pkg 5.19% <ø> (ø)
win_trunk_project 68.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ekcoh
Copy link
Collaborator

ekcoh commented Jul 3, 2025

Something must be off when it doesn't complete in 20 sec

@jfreire-unity
Copy link
Collaborator Author

Something must be off when it doesn't complete in 20 sec

I agree. I'll just disable them for now, wanted to make sure increasing them more would solve but I guess not.

@jfreire-unity jfreire-unity force-pushed the ci-ui-tests-increase-timeout-to-10-secs branch from c7ad62f to 099e53a Compare July 4, 2025 17:52
@jfreire-unity jfreire-unity requested a review from Copilot July 7, 2025 10:27
Copilot

This comment was marked as outdated.

@jfreire-unity
Copy link
Collaborator Author

Ok actually increasing the timeout worked when I previously thought it didn't. I forgot to set the timeout for WaitForDirty.

Failures we're seeing are on trunk for unrelated tests or setups.

@jfreire-unity jfreire-unity requested a review from Copilot July 7, 2025 10:41
Copilot

This comment was marked as outdated.

@jfreire-unity jfreire-unity requested review from K-Tone and ritamerkl July 7, 2025 11:02
Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

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

If it works it works. I wonder though what takes >5 seconds?

@jfreire-unity
Copy link
Collaborator Author

If it works it works. I wonder though what takes >5 seconds?

I didn't dig any further, but it seems a slow editor can cause this. This workaround is based on the discussion mentioned in Slack https://unity.slack.com/archives/C04RDRXRJ1L/p1751025119641109?thread_ts=1751017695.090649&cid=C04RDRXRJ1L

Copy link
Collaborator

@K-Tone K-Tone left a comment

Choose a reason for hiding this comment

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

I like this change very much, just wonder why wouldn't we apply Copilot's default value suggestions?

@jfreire-unity
Copy link
Collaborator Author

I like this change very much, just wonder why wouldn't we apply Copilot's default value suggestions?

Copilot gave me a different idea and I changed it now, but to the class where the methods we use in testing are defined, UIToolkitBaseTestWindow. Somehow, I thought this class was not in our package, but it is.

@jfreire-unity jfreire-unity requested a review from Copilot July 8, 2025 07:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR increases the default timeout for UI test wait routines from 5 seconds to a shared constant of 10 seconds to address CI instability.

  • Introduce kDefaultTimeoutSecs constant (10s) in UIToolkitBaseTestWindow
  • Update all wait methods in UIToolkitBaseTestWindow to use the new constant
  • Change default parameters in InputActionsEditorTests to reference the shared timeout and remove an outdated comment

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Assets/Tests/InputSystem.Editor/UIToolkitBaseTestWindow.cs Added kDefaultTimeoutSecs constant and updated default timeout parameters in wait methods
Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs Swapped hard-coded timeout defaults for kDefaultTimeoutSecs and removed an obsolete comment
Comments suppressed due to low confidence (1)

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs:48

  • The constant kDefaultTimeoutSecs is not defined in this file or its base class, resulting in a compilation error. Either qualify it or define a local constant or inherit from the class where it’s declared.
    IEnumerator WaitForActionMapRename(int index, bool isActive, double timeoutSecs = kDefaultTimeoutSecs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants