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

[NRBF] skip the most time-consuming test case for non-Release builds to avoid timeouts for checked builds #110550

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Dec 9, 2024

I was not able to reproduce a timeout, but I was able to notice that it takes a LOT of time to run (more than 10 minutes on a really beefy PC). I've attached a profiler and found the test case which was executing the worst case scenario (non-seekable stream from which we read 512k bytes one by one).

The command I've used after building the repo:

cmd.exe /C start /affinity F "D:\projects\runtime\artifacts\bin\testhost\net10.0-windows-Debug-x86\dotnet.exe" exec --runtimeconfig System.Formats.Nrbf.Tests.runtimeconfig.json --depsfile System.Formats.Nrbf.Tests.deps.json C:\Users\adsitnik\.nuget\packages\microsoft.dotnet.xunitconsolerunner\2.9.2-beta.24605.1\build\..\tools\net\xunit.console.dll System.Formats.Nrbf.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing
  Discovering: System.Formats.Nrbf.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Formats.Nrbf.Tests (found 150 test cases)
  Starting:    System.Formats.Nrbf.Tests (parallel test collections = on [4 threads], stop on fail = off)
    System.Formats.Nrbf.Tests.EdgeCaseTests.CanReadArrayOfAnySize [SKIP]
      Condition(s) not met: "Is64BitProcess"

fixes #110285

@adamsitnik adamsitnik requested a review from jkotas December 10, 2024 18:10
@@ -20,10 +20,15 @@ public NonSeekableStream(byte[] buffer) : base(buffer) { }

public static IEnumerable<object[]> GetCanReadArrayOfAnySizeArgs()
{
foreach (int size in new[] { 1, 127, 128, 512_001, 512_001 })
foreach (int size in new[] { 1, 127, 128, 512_001 })
Copy link
Member

Choose a reason for hiding this comment

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

Is 512_001 particularly interesting value to test for some reason?

Would it be simpler to just change 512_001 to something smaller, like 20_001?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing in particular, I am going to apply your suggestion.

@adamsitnik adamsitnik requested a review from jkotas December 11, 2024 16:19
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@jkotas jkotas merged commit c646425 into dotnet:main Dec 12, 2024
80 of 83 checks passed
hez2010 pushed a commit to hez2010/runtime that referenced this pull request Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Formats.Nrbf.Tests timeouts
2 participants