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

System.Threading.Tasks.Tests.TaskRunSyncTests outerloop tests fail on Mono on Linux MUSL #89921

Open
akoeplinger opened this issue Aug 3, 2023 · 1 comment
Labels
area-System.Threading.Tasks disabled-test The test is disabled in source code against the issue os-linux-musl Linux distributions using musl library.
Milestone

Comments

@akoeplinger
Copy link
Member

These tests are failing on Mono on musl but not on other Linux runs:

  Discovering: System.Threading.Tasks.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Threading.Tasks.Tests (found 177 of 777 test cases)
  Starting:    System.Threading.Tasks.Tests (parallel test collections = on, max threads = 2)
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest18 [FAIL]
      Assert.Equal() Failure
      Expected: 1
      Actual:   13
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(558,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest18()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Assert.Equal() Failure
      Expected: 1
      Actual:   9
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest15 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(532,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest15()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest23 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(599,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest23()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest19 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(566,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest19()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest20 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(575,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest20()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Assert.Equal() Failure
      Expected: 1
      Actual:   22
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(549,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest17()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest17 [FAIL]
      Did not expect a new Post to underlying SynchronizationContext
      Expected: True
      Actual:   False
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/TaskScheduler/TaskSchedulerTests.cs(267,0): at System.Threading.Tasks.Tests.TaskSchedulerTests.RunSynchronizationContextTaskSchedulerTests()
    System.Threading.Tasks.Tests.TaskSchedulerTests.RunSynchronizationContextTaskSchedulerTests [FAIL]
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.DroppedIncompleteStateMachine_RaisesIncompleteAsyncMethodEvent [SKIP]
      Test requires precise GC
  Finished:    System.Threading.Tasks.Tests
=== TEST EXECUTION SUMMARY ===
   System.Threading.Tasks.Tests  Total: 181, Errors: 0, Failed: 7, Skipped: 1, Time: 24.092s
@akoeplinger akoeplinger added disabled-test The test is disabled in source code against the issue area-CoreLib-mono os-linux-musl Linux distributions using musl library. labels Aug 3, 2023
@akoeplinger akoeplinger added this to the 9.0.0 milestone Aug 3, 2023
akoeplinger added a commit to akoeplinger/runtime that referenced this issue Aug 3, 2023
See dotnet#89921 for the test failures.

Additionally, the Android build was failing while compiling an AOT test due to this error:

```
/__w/1/s/artifacts/bin/Android.Device_Emulator.Aot.Test/Release/net8.0/android-x64/AppBundle/modules.c:51:6: error: no previous prototype for function 'register_aot_modules' [-Werror,-Wmissing-prototypes]
void register_aot_modules ()
     ^
```

This is because we turned on `-Werror=missing-prototypes` in dotnet#89197 but the MonoAOTCompiler didn't emit a function prototype in modules.c

Fixes dotnet#89566
akoeplinger added a commit that referenced this issue Aug 3, 2023
…ler (#89922)

See #89921 for the test failures.

Additionally, the Android build was failing while compiling an AOT test due to this error:

```
/__w/1/s/artifacts/bin/Android.Device_Emulator.Aot.Test/Release/net8.0/android-x64/AppBundle/modules.c:51:6: error: no previous prototype for function 'register_aot_modules' [-Werror,-Wmissing-prototypes]
void register_aot_modules ()
     ^
```

This is because we turned on `-Werror=missing-prototypes` in #89197 but the MonoAOTCompiler didn't emit a function prototype in modules.c

Fixes #89566
@ghost
Copy link

ghost commented Jan 26, 2024

Tagging subscribers to this area: @dotnet/area-system-threading-tasks
See info in area-owners.md if you want to be subscribed.

Issue Details

These tests are failing on Mono on musl but not on other Linux runs:

  Discovering: System.Threading.Tasks.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Threading.Tasks.Tests (found 177 of 777 test cases)
  Starting:    System.Threading.Tasks.Tests (parallel test collections = on, max threads = 2)
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest18 [FAIL]
      Assert.Equal() Failure
      Expected: 1
      Actual:   13
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(558,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest18()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Assert.Equal() Failure
      Expected: 1
      Actual:   9
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest15 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(532,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest15()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest23 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(599,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest23()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest19 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(566,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest19()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Task wasn't RunSynchronously with TaskScheduler specified
      Expected: True
      Actual:   False
      Stack Trace:
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest20 [FAIL]
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(305,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(575,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest20()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
      Assert.Equal() Failure
      Expected: 1
      Actual:   22
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(275,0): at System.Threading.Tasks.Tests.TaskRunSyncTest.RealRun()
        /_/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs(549,0): at System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest17()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    System.Threading.Tasks.Tests.TaskRunSyncTests.TaskRunSyncTest17 [FAIL]
      Did not expect a new Post to underlying SynchronizationContext
      Expected: True
      Actual:   False
      Stack Trace:
        /_/src/libraries/System.Threading.Tasks/tests/TaskScheduler/TaskSchedulerTests.cs(267,0): at System.Threading.Tasks.Tests.TaskSchedulerTests.RunSynchronizationContextTaskSchedulerTests()
    System.Threading.Tasks.Tests.TaskSchedulerTests.RunSynchronizationContextTaskSchedulerTests [FAIL]
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.DroppedIncompleteStateMachine_RaisesIncompleteAsyncMethodEvent [SKIP]
      Test requires precise GC
  Finished:    System.Threading.Tasks.Tests
=== TEST EXECUTION SUMMARY ===
   System.Threading.Tasks.Tests  Total: 181, Errors: 0, Failed: 7, Skipped: 1, Time: 24.092s
Author: akoeplinger
Assignees: -
Labels:

area-System.Threading.Tasks, disabled-test, os-linux-musl

Milestone: 9.0.0

@stephentoub stephentoub modified the milestones: 9.0.0, Future Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Threading.Tasks disabled-test The test is disabled in source code against the issue os-linux-musl Linux distributions using musl library.
Projects
None yet
Development

No branches or pull requests

3 participants