Update every package the solution can update, and adapt to xUnit v4 - #3064
Merged
Conversation
Dependabot's grouped bump (sebastienros#3034) fails CI on the new xUnit1069 analyzer, and three further packages are behind. This takes all of them and fixes what the new versions actually break. Bumped: xunit.v3.mtp-off and xunit.runner.visualstudio 4.0.0, Meziantou.Analyzer 3.0.167, Microsoft.CodeAnalysis(.Analyzers|.CSharp) 5.9.0, System.Text.Json 10.0.11, Test262Harness 1.1.2, YantraJS.Core 1.2.462. Everything else is either already current or only has a prerelease ahead of it (BenchmarkDotNet 0.16.0-preview.1, NUnit 5.0.0-beta.1, Verify.NUnit 32.0.0-beta.8, Newtonsoft.Json 13.0.5-beta1, the 11.0.0-preview Microsoft.Extensions/System.Text.Json line), which stays out. The Roslyn floor matches the compiler in the SDK the pipeline installs (10.0.400 ships Roslyn 5.9.0), and Test262Harness.Console in the tool manifest was already 1.1.2. Two code adjustments, both in Jint.Tests: xUnit1069 wants a test carrying a Timeout to reference the test's cancellation token, and it is right that GeneratorTests.YieldInForLoopUpdateExpression did not: the method is synchronous, so xUnit cannot abort it and the ten-second Timeout bought nothing — a regression that reintroduced the infinite loop would have hung the run rather than failing it. Handing the token to the engine as a CancellationConstraint is what makes the Timeout bite; measured, the engine now throws ExecutionCanceledException 2.9 s into a 3 s Timeout instead of spinning. EngineTests.TestDates fed DateTime values through MemberData, and xUnit 4.0.0 changed how a theory's DateTime argument is serialized: SerializationHelper now goes through ToRtf(), i.e. ToUniversalTime().ToString("O"), where it used to format the value as-is. For a DateTimeKind.Unspecified value ToUniversalTime() reinterprets it as the *runner machine's* local time and shifts it, so the test received an instant that depended on where the suite ran — and, being Utc, immediately threw out of `new DateTimeOffset(value, pacificOffset)`. These six dates are wall-clock readings in the Pacific zone, so they now travel as text and are parsed back with an explicit Unspecified kind, which is what they always meant. Green on Jint.Tests, Jint.Tests.PublicInterface (both also under JINT_HOST_CONTRACT_VERIFICATION=1), Jint.Tests.CommonScripts, Jint.Tests.SourceGenerators and Jint.Tests.Test262 (102,394 passed). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #3034, which fails CI on xUnit's new
xUnit1069analyzer rule. This takes the same three packages plus everything else the solution can move, and fixes what the new versions actually break.Packages
xunit.v3.mtp-offxunit.runner.visualstudioMeziantou.AnalyzerMicrosoft.CodeAnalysis.AnalyzersMicrosoft.CodeAnalysis.CSharpSystem.Text.JsonTest262HarnessYantraJS.CoreEverything else in
Directory.Packages.propsis already current or only has a prerelease ahead of it —BenchmarkDotNet0.16.0-preview.1,NUnit5.0.0-beta.1,Verify.NUnit32.0.0-beta.8,Newtonsoft.Json13.0.5-beta1, and the 11.0.0-previewMicrosoft.Extensions.*/System.Text.Jsonline — so those stay put.Test262Harness.ConsoleinJint.Tests.Test262/.config/dotnet-tools.jsonwas already 1.1.2.The Roslyn floor tracks the compiler in the SDK the pipeline installs: 10.0.400 ships Roslyn 5.9.0, so
Jint.SourceGeneratorsstill loads.Code adjustments
Both are in
Jint.Tests, and both are things the new versions were right to surface.xUnit1069— aTimeoutthat could not biteGeneratorTests.YieldInForLoopUpdateExpressioncarried[Fact(Timeout = 10000)]without referencing the test's cancellation token, which is exactly the rule's complaint. The method is synchronous, so xUnit cannot abort it on its own: a regression that reintroduced the infinite loop this test guards would have hung the run rather than failing it, and the ten seconds bought nothing.Handing the token to the engine as a
CancellationConstraintis what makes theTimeoutreal. Verified with a throwaway probe — an engine wired this way under a 3 sTimeoutthrowsExecutionCanceledException2.9 s intowhile (true) {}, where before it would have run until the process was killed.xUnit 4.0.0 changed how a theory's
DateTimeargument is serializedEngineTests.TestDatesfedDateTimevalues throughMemberData. In 3.2.2SerializationHelperformatted them as-is:In 4.0.0 it goes through
ToRtf(), which isToUniversalTime().ToString("O", CultureInfo.InvariantCulture). For aDateTimeKind.UnspecifiedvalueToUniversalTime()reinterprets it as the runner machine's local time and shifts it, so the test method received a different instant depending on where the suite ran —new DateTime(2000, 1, 1)arrived as1999-12-31T22:00:00Zhere (UTC+2). BeingUtc, it then threw straight out ofnew DateTimeOffset(value, pacificOffset)with "The UTC Offset for Utc DateTime instances must be 0", which is the second half of the CI failure on #3034.These six dates are wall-clock readings in the Pacific zone, so they now travel as text and are parsed back with an explicit
Unspecifiedkind — which is what they always meant, and no longer depends on the serializer's fidelity or on the runner's timezone.Verification
Release, all green:
Jint.Tests— 5,937 passed (net10.0), 5,852 passed (net472)Jint.Tests.PublicInterface— 1,488 / 1,487 passedJINT_HOST_CONTRACT_VERIFICATION=1Jint.Tests.CommonScripts— 28 passed on both frameworksJint.Tests.SourceGenerators— 52 passedJint.Tests.Test262— 102,394 passed, 287 skippedOne deliberate non-change:
Jint.Benchmark/README.md's "Engine versions" list still says YantraJS.Core 1.2.422. That list records the packages that produced the published comparison table, not the current pins, so bumping it without re-running the session would misattribute the numbers.The
linuxleg first failed onbuilt-ins/Atomics/waitAsync/returns-result-object-value-is-promise-resolves-to-timed-out.js. That family races a 1000 ms wall-clock budget and flakes onmaintoo — runs 32242568634 (...resolves-to-ok.js) and 32159876438 (true-for-timeout.js) are recent examples. Re-ran the job; green.