summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-05-16 15:13:50 +0200
committerGitHub <noreply@github.com>2022-05-16 15:13:50 +0200
commitfc840324a48ff30150c7891bc4798d262359ac70 (patch)
tree48e95a509a6caf14d6eacb8a36c84e3964bc5540
parent27d04fc70768a93f971c3d1d7fcbc2ba64e1d9f4 (diff)
parent507224c56ed2915d69443e522f1438c8efe9e67b (diff)
Merge pull request #22622 from vespa-engine/toregge/remove-disabled-unit-test
Remove disabled unit test that triggered compiler warnings
-rw-r--r--storage/src/tests/persistence/splitbitdetectortest.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/storage/src/tests/persistence/splitbitdetectortest.cpp b/storage/src/tests/persistence/splitbitdetectortest.cpp
index 86575c75b60..b93783f5cdf 100644
--- a/storage/src/tests/persistence/splitbitdetectortest.cpp
+++ b/storage/src/tests/persistence/splitbitdetectortest.cpp
@@ -162,46 +162,4 @@ TEST_F(SplitBitDetectorTest, zero_doc_limit_falls_back_to_one_bit_increase_on_gi
result.toString());
}
-/**
- * Not a regular unit test in itself, but more of an utility to find non-unique
- * document IDs that map to the same 58-bit bucket ID. Disabled by default since
- * it costs CPU to do this and is not necessary during normal testing.
- */
-TEST_F(SplitBitDetectorTest, DISABLED_find_bucket_collision_ids) {
- using document::DocumentId;
- using document::BucketId;
-
- document::BucketIdFactory factory;
-
- DocumentId targetId("id:foo:music:n=123456:ABCDEFGHIJKLMN");
- BucketId targetBucket(factory.getBucketId(targetId));
- char candidateSuffix[] = "ABCDEFGHIJKLMN";
-
- size_t iterations = 0;
- constexpr size_t maxIterations = 100000000;
- while (std::next_permutation(std::begin(candidateSuffix), std::end(candidateSuffix) - 1))
- {
- ++iterations;
-
- DocumentId candidateId(vespalib::make_string("id:foo:music:n=123456:%s",candidateSuffix));
- BucketId candidateBucket(factory.getBucketId(candidateId));
- if (targetBucket == candidateBucket) {
- std::cerr << "\nFound a collision after " << iterations
- << " iterations!\n"
- << "target: " << targetId << " -> " << targetBucket
- << "\ncollision: " << candidateId << " -> "
- << candidateBucket << "\n";
- return;
- }
-
- if (iterations == maxIterations) {
- std::cerr << "\nNo collision found after " << iterations
- << " iterations :[\n";
- return;
- }
- }
- std::cerr << "\nRan out of permutations after " << iterations
- << " iterations!\n";
-}
-
}