Closed Maoni0 closed 1 year ago
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries See info in area-owners.md if you want to be subscribed.
Author: | Maoni0 |
---|---|
Assignees: | - |
Labels: | `area-Infrastructure-libraries`, `blocking-clean-ci`, `Known Build Error` |
Milestone: | - |
Tagging subscribers to this area: @dotnet/area-system-formats-tar See info in area-owners.md if you want to be subscribed.
Author: | Maoni0 |
---|---|
Assignees: | - |
Labels: | `blocking-clean-ci`, `untriaged`, `Known Build Error`, `area-System.Formats.Tar` |
Milestone: | - |
System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(entryFormat: Pax, size: 8589934592, unseekableStream: False) [FAIL]
System.Collections.Generic.KeyNotFoundException : The given key 'size' was not present in the dictionary.
Stack Trace:
/_/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs(233,0): at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs(518,0): at System.Formats.Tar.TarHeader.WriteCommonFields(Span`1 buffer, TarEntryType actualEntryType)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs(366,0): at System.Formats.Tar.TarHeader.WritePaxFieldsToBuffer(Int64 size, Span`1 buffer)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs(385,0): at System.Formats.Tar.TarHeader.WriteFieldsToBuffer(TarEntryFormat format, Int64 bytesToWrite, Span`1 buffer)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs(40,0): at System.Formats.Tar.TarHeader.WriteAs(TarEntryFormat format, Stream archiveStream, Span`1 buffer)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs(228,0): at System.Formats.Tar.TarHeader.WriteAsPax(Stream archiveStream, Span`1 buffer)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs(297,0): at System.Formats.Tar.TarWriter.WriteEntryInternal(TarEntry entry)
/_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs(226,0): at System.Formats.Tar.TarWriter.WriteEntry(TarEntry entry)
/_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.LongFile.Tests.cs(40,0): at System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(TarEntryFormat entryFormat, Int64 size, Boolean unseekableStream)
at InvokeStub_TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:08:01
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:10:01
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:12:01
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:14:02
['System.Formats.Tar.Tests' END OF WORK ITEM LOG: Command timed out, and was killed]
Note there's apparently two issues, the failure due to KeyNotFoundException , and the below. Might need the test to be looped.
After fixing those, this test should probably become manual only, as it's running up against the 15 min timeout, even on release builds.
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:04:11
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:06:23
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:08:35
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:10:47
System.Formats.Tar.Tests: [Long Running Test] 'System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize', Elapsed: 00:12:59
System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(entryFormat: Pax, size: 8589934592, unseekableStream: False) [FAIL]
Assert.Equal() Failure
Expected: 8589934592
Actual: 0
Stack Trace:
/_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.LongFile.Tests.cs(48,0): at System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(TarEntryFormat entryFormat, Int64 size, Boolean unseekableStream)
at InvokeStub_TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
I had a look to see whether it's something simple.
this should be adding the size to the dictionary, but at this point _size is zero so it doesn't.
> System.Formats.Tar.dll!System.Formats.Tar.TarHeader.CollectExtendedAttributesFromStandardFieldsIfNeeded() Line 799 C#
System.Formats.Tar.dll!System.Formats.Tar.TarHeader.WriteAsPax(System.IO.Stream archiveStream, System.Span<byte> buffer) Line 223 C#
System.Formats.Tar.dll!System.Formats.Tar.TarWriter.WriteEntryInternal(System.Formats.Tar.TarEntry entry) Line 297 C#
System.Formats.Tar.dll!System.Formats.Tar.TarWriter.WriteEntry(System.Formats.Tar.TarEntry entry) Line 226 C#
System.Formats.Tar.Tests.dll!System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize(System.Formats.Tar.TarEntryFormat entryFormat, long size, bool unseekableStream) Line 40 C#
the size is not calculated and added to the extended attributes dictionary until here https://github.com/dotnet/runtime/blob/472091827b6a266f9d964564a77ba11160622a50/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs#L228
The 2nd failure mode is probably simply because its release mode and so it gets past the debug assert.
Probably introduced by https://github.com/dotnet/runtime/issues/76707 @Jozkee and wasn't spotted as it's outerloop?
thanks for taking a look, @danmoseley! it seems like the libraries outerloop has many errors. I did another PR that just triggers more background GCs with no other changes and it's still hitting many libraries outerloop failures (hard to say if it's hitting the exactly same issues since there isn't a convenient way to compare them when there are so many).
Yeah, I'm not sure what the process currently is for keeping the outerloop clean (@ericstj ). Hopefully it's not too difficult to identify anything new you introduce. Most of these failures are pretty vanilla.
it's actually not easy to identify new errors. as I mentioned, there isn't a convenient way to compare results - not that I know of anyway. and when Build Analysis does not categorize test failures it requires laboriously going through the tests marked as new to see if the failure on each test to see if it's actually a new error (not to mention Build Analysis does not necessarily give accurate results so that's already questionable). I've already spent a bunch of time on this so I think I will stop here.
Unlike PR validation which will have a forcing function to stay clean, outerloop is only clean based on folks responding to and resolving bugs.
@Maoni0 - are you needing to look in one particular area or are you trying to look across all areas?
no one area. I'm thinking of making a change in GC so I'm just looking for some test runs that might uncover problems.
https://github.com/dotnet/runtime/pull/76707 tried to get it fixed but it seems it didn't work Did fix it. Unfortunately, adding the [Outerloop]
attribute to a test class or a test method will cause it to get ignored when running locally, and if Outerloop tests aren't working in CI, they will not be executed. Which is why we couldn't catch it.
I'm working on a fix. _size
is being set too late when writing a PAX entry. It should be calculated before writing the extended attributes entry, so that if the number is too large to fit in the regular header, it should get written as an extended attribute.
Passing -p:Outloop=true
in -t:Test
command runs the outerloop test. I think we can make a basic version of "are all attributes accounted for" test in the regular CI.
Passing
-p:Outloop=true
in-t:Test
command runs the outerloop test.
Thanks @am11, I'll make sure to run those locally.
I think we can make a basic version of "are all attributes accounted for" test in the regular CI.
Not for this scenario, at least not easily. The size
extended attribute is only added when the data section size surpasses the max allowed number for the standard size
field. This is the reason why we had to write a test that simulates having a very large stream, pass it to the entry data stream, force it to get it all written in memory, and the size should've been detected as being larger than allowed, hence forcing the creation of the extended attribute. But unfortunately, this didn't happen.
It seems I introduced this bug when I merged the PR that refactored our Tar APIs to allow handling of unseekable data streams. The outerloop tests didn't run so I never caught the bug 😢 . https://github.com/dotnet/runtime/commit/84a7be769fa9054dac7a973dda538cf61a488e56
I'm currently testing the fix, will submit a PR soon.
Passing
-p:Outloop=true
in-t:Test
command runs the outerloop test
Tiny typo BTW: it's Outerloop
😸 .
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=302240 Build error leg or test failing: System.Formats.Tar.Tests.TarWriter_WriteEntry_LongFile_Tests.WriteEntry_LongFileSize System.Formats.Tar.Tests.TarWriter_WriteEntryAsync_LongFile_Tests.WriteEntry_LongFileSizeAsync Pull request: https://github.com/dotnet/runtime/pull/87311
Error Message
Fill the error message using step by step known issues guidance.
Report
Summary
Known issue validation
Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=324045 Error message validated:
System.Collections.Generic.KeyNotFoundException : The given key 'size' was not present in the dictionary.
Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 6/28/2023 9:23:56 PM UTC