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

[wasm] System.Runtime.Loader.Tests fail when run in randomized order #65672

Closed
radical opened this issue Feb 21, 2022 · 16 comments
Closed

[wasm] System.Runtime.Loader.Tests fail when run in randomized order #65672

radical opened this issue Feb 21, 2022 · 16 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-AssemblyLoader-mono needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity
Milestone

Comments

@radical
Copy link
Member

radical commented Feb 21, 2022

Found on #65628 .

System.Runtime.Loader.Tests fail randomly, but deterministically with XUNIT_RANDOM_ORDER_SEED=2106784294.

[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)

Maybe these tests have some unintended dependence on order?
To test it with that PR, make sure to false from the csproj.

@radical radical added the arch-wasm WebAssembly architecture label Feb 21, 2022
@ghost
Copy link

ghost commented Feb 21, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Found on #65628 .

System.Runtime.Loader.Tests fail randomly, but deterministically with XUNIT_RANDOM_ORDER_SEED=2106784294.

[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)

Maybe these tests have some unintended dependence on order?
To test it with that PR, make sure to false from the csproj.

Author: radical
Assignees: -
Labels:

arch-wasm

Milestone: -

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 21, 2022
@ghost
Copy link

ghost commented Feb 22, 2022

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Found on #65628 .

System.Runtime.Loader.Tests fail randomly, but deterministically with XUNIT_RANDOM_ORDER_SEED=2106784294.

[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)

Maybe these tests have some unintended dependence on order?
To test it with that PR, make sure to false from the csproj.

Author: radical
Assignees: -
Labels:

arch-wasm, untriaged, area-AssemblyLoader-mono

Milestone: -

@akoeplinger akoeplinger removed the untriaged New issue has not been triaged by the area owner label Mar 24, 2022
@akoeplinger akoeplinger added this to the 7.0.0 milestone Mar 24, 2022
@ilonatommy
Copy link
Member

Still failing.

@lewing
Copy link
Member

lewing commented Jul 25, 2022

@vargaz can you make sure we understand the issue here?

@vargaz
Copy link
Contributor

vargaz commented Jul 26, 2022

Can't reproduce this. I ran with:

XUNIT_RANDOM_ORDER_SEED=2106784294 EMSDK_PATH=$REPO/src/mono/wasm/emsdk/ ./dotnet.sh build /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release src/libraries/System.Runtime.Loader/tests/

@radical
Copy link
Member Author

radical commented Jul 26, 2022

Did you disable this?

<XUnitUseRandomizedTestOrderer>false</XUnitUseRandomizedTestOrderer>

@vargaz
Copy link
Contributor

vargaz commented Jul 26, 2022

I can reproduce now.

@vargaz
Copy link
Contributor

vargaz commented Aug 1, 2022

Fails without randomized order as well. Testcase:

using System;
using System.Reflection;
using System.Resources;
using System.Globalization;
using Xunit;

namespace System.Runtime.Loader.Tests
{
    public class SatelliteAssembliesTestsFixture
    {
            [Fact]
            public void FOO () {
                string assemblyName = "System.Runtime.Loader.Tests";

                AssemblyName satelliteAssemblyName = new AssemblyName(assemblyName + ".resources");
                satelliteAssemblyName.CultureInfo = new CultureInfo("en");

                var alc = new AssemblyLoadContext("Empty");

                Assembly satelliteAssembly = alc.LoadFromAssemblyName(satelliteAssemblyName);

                Assembly parentAssembly = alc.LoadFromAssemblyName(new AssemblyName(assemblyName));

                Console.WriteLine (parentAssembly == typeof (SatelliteAssembliesTestsFixture).Assembly);
                Assert.Equal (parentAssembly, typeof (SatelliteAssembliesTestsFixture).Assembly);
        }
    }
}

@vargaz
Copy link
Contributor

vargaz commented Aug 1, 2022

Commenting out the:

                Assembly satelliteAssembly = alc.LoadFromAssemblyName(satelliteAssemblyName);

line makes the test pass.

@radical radical modified the milestones: 7.0.0, 8.0.0 Aug 12, 2022
@lewing lewing added the needs-author-action An issue or pull request that requires more info or actions from the author. label Aug 13, 2023
@lewing lewing modified the milestones: 8.0.0, 9.0.0 Aug 13, 2023
@ghost
Copy link

ghost commented Aug 13, 2023

This issue has been marked needs-author-action and may be missing some important information.

@ghost ghost added the no-recent-activity label Aug 27, 2023
@ghost
Copy link

ghost commented Aug 27, 2023

This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

@ghost
Copy link

ghost commented Sep 10, 2023

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@ghost ghost closed this as completed Sep 10, 2023
@vargaz vargaz reopened this Sep 10, 2023
@ghost ghost removed the no-recent-activity label Sep 10, 2023
@ghost ghost added the no-recent-activity label Sep 24, 2023
@ghost
Copy link

ghost commented Sep 24, 2023

This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

@vargaz vargaz closed this as completed Sep 24, 2023
@vargaz vargaz reopened this Sep 24, 2023
@ghost ghost removed the no-recent-activity label Sep 24, 2023
@ghost ghost added the no-recent-activity label Oct 8, 2023
@ghost
Copy link

ghost commented Oct 8, 2023

This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

@ghost
Copy link

ghost commented Oct 23, 2023

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@ghost ghost closed this as completed Oct 23, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-AssemblyLoader-mono needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity
Projects
None yet
Development

No branches or pull requests

6 participants