Skip to content

Commit 53abc8d

Browse files
FIX: Integration tests CI instability on Integration_CanSendAndReceiveEvents (#1693)
* Set background settings to ignore focus This makes the devices adding during tests to be enabled regardless of the standalone player application focus. * Update CHANGELOG
1 parent 502e854 commit 53abc8d

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ however, it has to be formatted properly to pass verification tests.
1515

1616
### Fixed
1717
- Fixed UI clicks not registering when OS provides multiple input sources for the same event, e.g. on Samsung Dex (case ISX-1416, ISXB-342).
18+
- Fixed unstable integration test `Integration_CanSendAndReceiveEvents` by ignoring application focus on integration tests. (case ISX-1381)
1819

1920
## [1.6.1] - 2023-05-26
2021

Packages/com.unity.inputsystem/Tests/IntegrationTests/IntegrationTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ public static void PreserveMethods()
6868
var dummy = new System.ComponentModel.StringConverter();
6969
}
7070

71+
[SetUp]
72+
public virtual void Setup()
73+
{
74+
// The standalone player can go out of focus when running tests. This makes the devices added during tests set
75+
// as disabled. Which in turn makes the InputSystem update not process input state changes for devices.
76+
// By ignoring focus, we can protect ourselves against this and always update the device state in the standalone
77+
// test players
78+
InputSystem.settings.backgroundBehavior = InputSettings.BackgroundBehavior.IgnoreFocus;
79+
}
80+
81+
[TearDown]
82+
public virtual void TearDown()
83+
{
84+
InputSystem.settings.backgroundBehavior = default;
85+
}
86+
7187
[Test]
7288
[Category("Integration")]
7389
public void Integration_CanSendAndReceiveEvents()

0 commit comments

Comments
 (0)