apple / swift-collections

Commonly used data structures for Swift
Apache License 2.0
3.55k stars 270 forks source link

[test] TreeDictionary.Keys: Remove stray print that’s flooding test output #370

Open lorentey opened 3 weeks ago

lorentey commented 3 weeks ago

The test_isEqual_exhaustive test includes a stray print statement that is flooding test output with a myriad lines of useless data.

Checklist

lorentey commented 3 weeks ago

@swift-ci test

vanvoorden commented 3 weeks ago

@lorentey Ahh… this is a good fix! Sorry about that one. Would these fixes happen enough that some kind of linter that automatically flags a diff with print in test code would be impactful?

lorentey commented 3 weeks ago

@vanvoorden Oh I didn't even remember this was a recent addition. This is not a big deal! And it's pretty easy to catch by looking through CI output -- which is how this one came to light.

It can be legitimate for tests to print, and I don't think we want to develop a linter for this. We can simply catch these as they happen.

lorentey commented 3 weeks ago

Huh, this isn't ideal:

swift-frontend: /home/build-user/swift/include/swift/SIL/AbstractionPattern.h:529: void swift::Lowering::AbstractionPattern::initSwiftType(swift::SubstitutionMap, swift::CanGenericSignature, swift::CanType, swift::Lowering::AbstractionPattern::Kind): Assertion `signature || !origType->hasTypeParameter()' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.  Program arguments: /usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /build/swift-collections/Tests/HashTreeCollectionsTests/Colliders.swift /build/swift-collections/Tests/HashTreeCollectionsTests/Hash.swift "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeDictionary Smoke Tests.swift" "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift" "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeDictionary.Keys Tests.swift" "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeDictionary.Values Tests.swift" "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift" "/build/swift-collections/Tests/HashTreeCollectionsTests/TreeSet Tests.swift" /build/swift-collections/Tests/HashTreeCollectionsTests/Utilities.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/Modules -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -D COLLECTIONS_RANDOMIZED_TESTING -empty-abi-descriptor -Xcc -working-directory -Xcc /build/swift-collections -resource-dir /usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /build/swift-collections -Xcc -fPIC -Xcc -g -Xcc -fno-omit-frame-pointer -module-name HashTreeCollectionsTests -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins -emit-module-doc-path /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/Modules/HashTreeCollectionsTests.swiftdoc -emit-module-source-info-path /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/Modules/HashTreeCollectionsTests.swiftsourceinfo -emit-dependencies-path /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/HashTreeCollectionsTests.build/HashTreeCollectionsTests.emit-module.d -parse-as-library -o /build/swift-collections/.build/x86_64-unknown-linux-gnu/debug/Modules/HashTreeCollectionsTests.swiftmodule
1.  Swift version 6.0-dev (LLVM b3d7c45a25a792f, Swift 81534a6c151c6ed)
2.  Compiling with effective version 5.10
3.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for module HashTreeCollectionsTests)
4.  While silgen emitFunction SIL function "@$s23_CollectionsTestSupport15LifetimeTrackerC08HashTreeA5TestsE19shareableDictionary_4with0fgA00gJ0VyAA0D7TrackedCy3KeyQy_GAKy5ValueQy_GG3map_SDyAnQG8expectedtx_q_tSTRzAD13DataGeneratorR_Si7ElementRtzr0_lF".
 for 'shareableDictionary(_:with:)' (at /build/swift-collections/Tests/HashTreeCollectionsTests/Utilities.swift:87:3)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):

This looks like a recent compiler regression. I'll look into it tomorrow.

lorentey commented 2 weeks ago

@swift-ci test