]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Deflake test `CompactionJobTest.InputSerialization` (#8712)
authorJay Zhuang <zjay@fb.com>
Thu, 26 Aug 2021 16:26:41 +0000 (09:26 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 26 Aug 2021 16:27:37 +0000 (09:27 -0700)
Summary:
It's invalid to have an empty file name.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8712

Test Plan:
```
$ gtest-parallel ./compaction_job_test --gtest_filter=CompactionJobTest.InputSerialization -r 10000
```

Reviewed By: pdillinger

Differential Revision: D30566739

Pulled By: jay-zhuang

fbshipit-source-id: 41e73175e3c95c4b73b4fdcd33470788d4e29d37

db/compaction/compaction_job_test.cc

index b4e96538718e2e60fb6bc1823b373e68ab5d3aa4..4da4c7411f6bdc06b23504a117692764ee117334 100644 (file)
@@ -1120,7 +1120,9 @@ TEST_F(CompactionJobTest, InputSerialization) {
     input.snapshots.emplace_back(rnd64.Uniform(UINT64_MAX));
   }
   while (!rnd.OneIn(10)) {
-    input.input_files.emplace_back(rnd.RandomString(rnd.Uniform(kStrMaxLen)));
+    input.input_files.emplace_back(rnd.RandomString(
+        rnd.Uniform(kStrMaxLen - 1) +
+        1));  // input file name should have at least one character
   }
   input.output_level = 4;
   input.has_begin = rnd.OneIn(2);