Skip to content

HashSet_class_A01_t01 relies on internal details of ordering in HashSet implementation #1430

@aam

Description

@aam

The test expects any check-method to be invoked certain number of types.
Number of times it is invoked depends on the ordering of the elements in which any visits them.
Hardcoding expected number of times check is called is problematic, breaks if we change hashCode function.

From https://dart-review.googlesource.com/c/sdk/+/258600 run: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8803031198557259105/+/u/test_results/new_test_failures__logs_

/=====================================================================================================\
| co19_2/LibTest/collection/HashSet/HashSet_class_A01_t01 broke (Pass -> RuntimeError, expected Pass) |
\=====================================================================================================/

--- Command "vm" (took 01.000692s):
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart -Dtest_runner.configuration=dartk-linux-release-x64 --ignore-unrecognized-flags --packages=/b/s/w/ir/.dart_tool/package_config.json /b/s/w/ir/tests/co19_2/src/LibTest/collection/HashSet/HashSet_class_A01_t01.dart

exit code:
255

stderr:
Unhandled exception:
Expect.equals(expected: <4>, actual: <1>) fails.
#0      _fail (file:///b/s/w/ir/tests/co19_2/src/Utils/expect.dart:22:5)
#1      Expect.equals (file:///b/s/w/ir/tests/co19_2/src/Utils/expect_common.dart:31:5)
#2      check (file:///b/s/w/ir/tests/co19_2/src/LibTest/core/Iterable/any_A01_t05.test.dart:26:10)
#3      test (file:///b/s/w/ir/tests/co19_2/src/LibTest/core/Iterable/any_A01_t05.test.dart:45:3)
#4      test (file:///b/s/w/ir/tests/co19_2/src/LibTest/core/Iterable/allTests.lib.dart:105:15)
#5      test (file:///b/s/w/ir/tests/co19_2/src/LibTest/core/Set/all_tests.lib.dart:57:18)
#6      test (file:///b/s/w/ir/tests/co19_2/src/LibTest/collection/HashSet/inherited_tests.lib.dart:17:13)
#7      main (file:///b/s/w/ir/tests/co19_2/src/LibTest/collection/HashSet/HashSet_class_A01_t01.dart:24:10)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

--- Re-run this test:
python3 tools/test.py -n dartk-linux-release-x64 co19_2/LibTest/collection/HashSet/HashSet_class_A01_t01

Metadata

Metadata

Assignees

Labels

type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions