-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Correctly skip PosixSignalRegistrationTests on mobile #55643
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
Correctly skip PosixSignalRegistrationTests on mobile #55643
Conversation
dotnet#55569 didn't fix the issue since xunit retrieves the MemberData and checks for non-empty *before* evaluating the ConditionalTheory condition.
This tool is driving me nuts ;-) |
...me.InteropServices/tests/System/Runtime/InteropServices/PosixSignalRegistrationTests.Unix.cs
Show resolved
Hide resolved
|
@stephentoub btw. I saw that we have Line 12 in 9ad44f8
Could you please check whether it runs on Windows? |
|
|
|
@stephentoub just to make sure can you open the testResults.xml and verify it did run the |
|
It didn't run it because there's nothing to run. |
|
Yeah but I'd have expected the discovery to fail due to the empty MemberData. If I take this and run it I get an error (with a using System;
using System.Linq;
using System.Collections.Generic;
using Xunit;
using Microsoft.DotNet.XUnitExtensions;
public class UnitTest
{
public static IEnumerable<object[]> UninstallableSignals() => Enumerable.Empty<object[]>();
public static bool IsSupported => false;
[ConditionalTheory(typeof(UnitTest), nameof(UnitTest.IsSupported))]
[MemberData(nameof(UninstallableSignals))]
public void TestSignal(int signal)
{
Assert.True(signal > 0);
}
}$ dotnet test
Test run for /Users/alexander/dev/test/xunittest/bin/Debug/net6.0/xunittest.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.0.0-preview-20210512-01
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:02.12] UnitTest.TestSignal [FAIL]
Failed UnitTest.TestSignal [1 ms]
Error Message:
System.InvalidOperationException : No data found for UnitTest.TestSignal
Failed! - Failed: 1, Passed: 0, Skipped: 0, Total: 1, Duration: < 1 ms - /Users/alexander/dev/test/xunittest/bin/Debug/net6.0/xunittest.dll (net6.0) |
|
Hm I wonder if this is a difference in how |
|
|
Very strange 😕 |
|
If I change this:
to true, then I get that failure message (though I also get a ton of "Skipping test case with duplicate ID" and "Non-serializable data" found warnings). I wonder if this file is being used on Windows but not elsewhere? |
|
Ah interesting, that makes sense. Yes we don't use that file on the mobile xunit runner. I guess |
|
Glad we got to the bottom of it. FWIW, if memory serves, we disabled preEnumerateTheories because the enumeration was taking a very long time in some situations, and disabling it shaved off a measurable amount of time from running tests. Might be something to look at for our mobile runs, to at least see if there's any measurable impact. It was particularly impactful for PLINQ, where we have something like 200,000 test cases that come from a much, much smaller number of [Theory]s. |
|
Yup. Turns out it was already disabled for the Browser xunit runner, sent a PR to also disable it for iOS/Android :) |
#55569 didn't fix the issue since xunit retrieves the MemberData and checks for non-empty before evaluating the ConditionalTheory condition.