tests: mutation_source_test: generate valid utf-8 data

test_fast_forwarding_across_partitions_to_empty_range uses an uninitialized
string to populate an sstable, but this can be invalid utf-8 so that sstable
cannot be sstabledumped.

Make it valid by using make_random_string().

Fixes #4040.
Message-Id: <20190107193240.14409-1-avi@scylladb.com>

(cherry picked from commit d8adbeda11)
This commit is contained in:
Avi Kivity
2019-01-07 21:32:40 +02:00
parent ba62dcd5c7
commit 2fcae36d96

View File

@@ -32,6 +32,7 @@
#include "mutation_rebuilder.hh"
#include "random-utils.hh"
#include "cql3/cql3_type.hh"
#include "make_random_string.hh"
#include <boost/algorithm/string/join.hpp>
// partitions must be sorted by decorated key
@@ -289,7 +290,7 @@ static void test_fast_forwarding_across_partitions_to_empty_range(populate_fn po
for (auto&& key : keys) {
mutation m(s, key);
sstring val(sstring::initialized_later(), 1024);
sstring val = make_random_string(1024);
for (auto i : boost::irange(0u, ckeys_per_part)) {
table.add_row(m, table.make_ckey(next_ckey + i), val);
}