dotnet / dotnet/arcade

RemoteExecutor field marshaling failure when in Live Unit Testing

Open
#14,634 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

### Summary

55 unit tests in the [dotnet/maintenance-packages](https://github.com/dotnet/maintenance-packages) repo that try to use `RemoteExecutor` are failing due to unsupported field marshaling when attempting to run them with Live Unit Testing.

Note that all the unit tests pass without any issues in all other contexts:
- When running them with regular Text Explorer.
- When executed via CLI using `dotnet test`.
- When executed in the CI (rolling builds or PRs).

@dotnet/interop-contrib @dotnet/runtime-infrastructure

### Repro steps

1. Open the solution using the `build.cmd -vs MaintenancePackages.sln` command.
2. Test menu -> Live Unit Testing -> Start. If asked, choose a location for the `lut` folder. Wait for the tests to finish.
3. Go to the Live Unit Testing tab. Select any of the failing tests. The callstack will look something like this:

```
 System.Buffers.ArrayPool.Tests.ArrayPoolUnitTests.RentBufferFiresRentedDiagnosticEvent

Message: 
System.ArgumentException : Field marshaling is not supported by Invoke: CS$InstrumentationPayload1

Stack Trace: 
RemoteExecutor.GetMethodInfo(Delegate d) line 596
RemoteExecutor.Invoke(Action method, RemoteInvokeOptions options) line 118
ArrayPoolTest.RemoteInvokeWithTrimming(Action method, Int32 timeout) line 48
ArrayPoolUnitTests.RentBufferFiresRentedDiagnosticEvent() line 403
```

The exception is being thrown in line 596:
https://github.com/dotnet/arcade/blob/162990f9a2002aba463bea29e4db1d416cf9d5fd/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs#L578-L596

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.