Search Issue Tracker

Fixed

Votes

3

Found in [Package]

Issue ID

1202815

Regression

Yes

UnityEngine.Events : InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread

Package: Test-Framework

-

When updating a project from 2019.3 (where all tests pass) to 2020.1.0b15. Test now fail with the below errors.

InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread
UnityEngine.Object.EnsureRunningOnMainThread () (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Object.GetInstanceID () (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Object.op_Inequality (UnityEngine.Object x, UnityEngine.Object y) (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Events.PersistentCall.ValidateTargetAssemblyType () (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)
UnityEngine.Events.PersistentCall.OnAfterDeserialize () (at <5707d5c1fe2c4727a5067f1685c0f37a>:0)

Seems to be crashing on assertion. I'm using the 1.1.5 package in both versions
.
Unhandled log message: '[Exception] InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread'. Use UnityEngine.TestTools.LogAssert.Expect

Steps to reproduce
- Open the attached project
- Open Test Runner palette.
- Open play mode tests
- Run tests
Notice issue >> Test 9,12,14,19 fail with Unhandled log message: '[Exception] InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread'. Use UnityEngine.TestTools.LogAssert.Expect

Test Broken
Unity 2020.1.0a15
Test Framework Package "1.1.5",
Windows 10

Tested Working
Windows - 2020.3.0f1, macoS 2020.1.0a15
Test Framework Package "1.1.5",

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.