From 4afa24f8ae18aa4e173835f70bb608d336b46554 Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Thu, 26 Aug 2021 09:26:41 -0700 Subject: [PATCH] Deflake test `CompactionJobTest.InputSerialization` (#8712) 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/compaction/compaction_job_test.cc b/db/compaction/compaction_job_test.cc index b4e965387..4da4c7411 100644 --- a/db/compaction/compaction_job_test.cc +++ b/db/compaction/compaction_job_test.cc @@ -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);