Skip to content
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

[AutoLayout] restore disabled When_Hug_With_CounterAlignment test #1203

Open
Xiaoy312 opened this issue Jul 24, 2024 · 3 comments
Open

[AutoLayout] restore disabled When_Hug_With_CounterAlignment test #1203

Xiaoy312 opened this issue Jul 24, 2024 · 3 comments
Assignees
Labels
control/auto-layout kind/bug Something isn't working kind/regression Something was working, now it isn't

Comments

@Xiaoy312
Copy link
Contributor

this test is failing for android since we upgraded from 5.0.154 to 5.4.0-dev.738

@Xiaoy312 Xiaoy312 added kind/bug Something isn't working kind/regression Something was working, now it isn't control/auto-layout labels Jul 24, 2024
@carldebilly carldebilly removed their assignment Jul 25, 2024
@rajamatt
Copy link
Contributor

rajamatt commented Aug 16, 2024

@kazo0 The test starts failing with 5.2.80

Expected value to approximate 0.0 +/- 1.0, but 106.47618865966797 differed by 106.47618865966797.

Full test case

<test-run id="b2224ae4-e526-4089-8bc0-74b754d79eb8" name="Runtime Tests" testcasecount="3" result="Failed" time="0" total="3" errors="0" passed="2" failed="1" inconclusive="0" skipped="0" asserts="0" run-date="2024-08-16" start-time="11:34:15" end-time="11:34:15">
  <test-suite type="Assembly" name="Uno.Toolkit.RuntimeTests">
    <environment machine-name="localhost" platform="n/a" />
    <test-suite type="TestFixture" name="b2224ae4-e526-4089-8bc0-74b754d79eb8" executed="true" testcasecount="3" result="Failed" time="0" total="3" errors="0" passed="2" failed="1" inconclusive="0" skipped="0" asserts="0">
      <test-case name="When_Hug_With_CounterAlignment()" fullname="When_Hug_With_CounterAlignment()" duration="0.4237915" time="0" result="Failed">
        <failure>
          <message>Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Expected value to approximate 0.0 +/- 1.0, but 106.47618865966797 differed by 106.47618865966797.
   at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\LateBoundTestFramework.cs:line 21
   at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\TestFrameworkProvider.cs:line 40
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\DefaultAssertionStrategy.cs:line 29
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 223
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 196
   at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 238
   at FluentAssertions.NumericAssertionsExtensions.FailIfDifferenceOutsidePrecision[Double](Boolean differenceWithinPrecision, NumericAssertions`1 parent, Double expectedValue, Double precision, Double actualDifference, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\NumericAssertionsExtensions.cs:line 959
   at FluentAssertions.NumericAssertionsExtensions.BeApproximately(NumericAssertions`1 parent, Double expectedValue, Double precision, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\NumericAssertionsExtensions.cs:line 848
   at Uno.Toolkit.RuntimeTests.Tests.AutoLayoutTest.When_Hug_With_CounterAlignment() in C:\P\uno.toolkit.ui\src\Uno.Toolkit.RuntimeTests\Tests\AutoLayoutTest.cs:line 772
   at Uno.UI.RuntimeTests.UnitTestsControl.&lt;&gt;c__DisplayClass66_0.&lt;&lt;ExecuteTestsForInstance&gt;g__WaitResult|3&gt;d.MoveNext() in C:\Users\MatthewRajala\.nuget\packages\uno.ui.runtimetests.engine\0.25.0-dev.99\src\Engine\UI\UnitTestsControl.cs:line 1034
--- End of stack trace from previous location ---
   at Uno.UI.RuntimeTests.UnitTestsControl.&lt;&gt;c__DisplayClass66_3.&lt;&lt;ExecuteTestsForInstance&gt;g__DoInvoke|9&gt;d.MoveNext() in C:\Users\MatthewRajala\.nuget\packages\uno.ui.runtimetests.engine\0.25.0-dev.99\src\Engine\UI\UnitTestsControl.cs:line 910
--- End of stack trace from previous location ---
   at Uno.UI.RuntimeTests.UnitTestsControl.&lt;&gt;c__DisplayClass68_0.&lt;&lt;ExecuteOnDispatcher&gt;b__0&gt;d.MoveNext() in C:\Users\MatthewRajala\.nuget\packages\uno.ui.runtimetests.engine\0.25.0-dev.99\src\Engine\UI\UnitTestsControl.cs:line 1055
--- End of stack trace from previous location ---
   at Uno.UI.RuntimeTests.UnitTestsControl.ExecuteOnDispatcher(Func`1 asyncAction, CancellationToken ct) in C:\Users\MatthewRajala\.nuget\packages\uno.ui.runtimetests.engine\0.25.0-dev.99\src\Engine\UI\UnitTestsControl.cs:line 1065
   at Uno.UI.RuntimeTests.UnitTestsControl.&lt;&gt;c__DisplayClass66_2.&lt;&lt;ExecuteTestsForInstance&gt;g__InvokeTestMethod|5&gt;d.MoveNext() in C:\Users\MatthewRajala\.nuget\packages\uno.ui.runtimetests.engine\0.25.0-dev.99\src\Engine\UI\UnitTestsControl.cs:line 899</message>
        </failure>
      </test-case>
    </test-suite>
  </test-suite>
</test-run>

@kazo0
Copy link
Contributor

kazo0 commented Aug 17, 2024

@rajamatt it looks like 5.2.80 is the first stable version that this started failing on. But it'll be easier to narrow down the cause if we can find the first -dev.XXX version of 5.2 that this started happening with. So I tested 5.1.104 and it works and it fails on 5.2.0-dev.2114 so somewhere in one of the 5.2.0-dev.XXX builds is where it started to fail. Can you try and narrow it down and find the specific build?

@kazo0
Copy link
Contributor

kazo0 commented Aug 17, 2024

Ah this is because of #1051. There is an outstanding issue if the AutoLayout is the absolute root element of the application Window. Which is not a common scenario outside of UI Tests that are replacing the window content. For now we can workaround this by wrapping the AutoLayout in a Border.

@kazo0 kazo0 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2024
@kazo0 kazo0 reopened this Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/auto-layout kind/bug Something isn't working kind/regression Something was working, now it isn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants