Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@Jonarw
Copy link
Member

@Jonarw Jonarw commented Jul 20, 2024

.NET 7 is out of support by now, so prior to a potential v2.2 release, we should upgrade all .NET 7 targets to .NET 8.
.NET 6 is still supported until end of 2024, so this can stay.

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • Replace all .NET 7 targets by .NET 8
  • Add .NET 6 and .NET 8 targets to OxyPlot.Skiasharp (not sure why we didn't have these before)

@oxyplot/admins

Copy link
Contributor

@VisualMelon VisualMelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be looking at NUnit 4?

@VisualMelon
Copy link
Contributor

Seems there are an awful lot of breaking changes in NUnit 4

@Jonarw
Copy link
Member Author

Jonarw commented Jul 20, 2024

Yes I also tried NUnit 4 at first and saw the amount of breaking changes, so I reverted to the latest 3.x version.
I also don't really understand the error we are getting, and why everything is fine on Azure but not on GitHub Actions. Will look into it some more later.

@VisualMelon
Copy link
Contributor

Encountered infinite recursion while looking up resource 'Arg_NullReferenceException' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.

Don't think I've seen that before; dotnet/runtime#72381 has some commentary on it: maybe it's a clue

@VisualMelon
Copy link
Contributor

At least one of net8.0-windows tests (OxyPlot.Wpf.Tests) are failing for me locally when run with dotnet test: seeing the same infinite recursion error, but not much that is diagnostically useful, and it's not deterministic. It looks like a window is briefly trying to open before it dies. Everything else (e.g. net8.0 and net6.0-windows) seems to be OK.

Also had some sort of weird error state trying to run the WPF tests for net8 in Visual Studio also, but VS seemed at least as confused as me so don't want to read too much into that.

@Jonarw
Copy link
Member Author

Jonarw commented Jul 20, 2024

Documenting my findings so far, mostly so I will remember them myself:

  • This is very weird
  • The error occurs while running OxyPlot.Wpf.Tests
  • It happens only for .NET 8, not for .NET 6, .NET 7 or Framework 4.6.2
  • I can reproduce the crash with same error message on my local Windows 11 machine by running dotnet test Source/OxyPlot.Wpf.Tests/OxyPlot.Wpf.Tests.csproj --configuration Release from command line
  • The crash does not happen when PlotViewTests are excluded from the test run (but all other tests are included)
  • The crash does not happen when PlotViewTests are run individually
  • It does not happen when running the tests via Visual Studio Test Explorer

Will continue to investigate later.

@VisualMelon
Copy link
Contributor

VisualMelon commented Jul 20, 2024

Repro'd everything you describe on my Win10 machine. Further, it seems not to occur in any of the following situations:

  • comment out the two tests that try to open a window
  • remove the [RequiresThread(System.Threading.ApartmentState.STA)] attribute on the same two tests
  • change RequiresThread attribute to Appartment on the same two tests

It's been years and years since I had any idea what STA and MTA had to do with anything, but I also tried disabling just one of the tests (RequiresThread suggests it will always start a new thread, and that sounds problematic for STA) and that didn't help. I can't find anything about this after a quick search, but the third option seems like a reasonable thing to try to see if it makes the CI happy.

@Jonarw
Copy link
Member Author

Jonarw commented Jul 20, 2024

I think the RequiresThread attribute can just be removed. All tests run in STA mode anyway because of [assembly: Apartment(ApartmentState.STA)] in AssemblyInfo.cs.
I don't quite understand why this would lead to the kind of crash we had here, but at least locally this fixes it. Let's see what the CI thinks about it.

@Jonarw
Copy link
Member Author

Jonarw commented Jul 20, 2024

This seems to have done the trick 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.