# In this test, we run the randomized testing framework with both the
# rand_ranges and rand_cluster options. We expect that the range_gen and
# cluster_gen configurations will change across iterations and runs.
#
# When a specific generator type is used, we expect the numbers generated to
# form a distribution. Due to limited sample size, it can be hard to observe the
# corresponding distribution pattern, but we can confirm that the parameters are
# set correctly and numbers generated look roughly accurate.
#
# Other parameters, such as replication factor and placement type should also be
# set and remain consistent across iterations.
rand_cluster cluster_gen_type=single_region
----

# We expect the placement of ranges across stores to be randomized with a
# replication factor of 3. range∈[1, 1000] should be generated with an uniform
# distribution pattern across iterations. The numbers generated are
# (305,944,479,487,285,611,271,502,865,787) - randomly distributed within [1,
# 1000]. keyspace∈[1000, 200000] should be generated with a zipf distribution
# pattern across iterations (1015,2357,1003,2171,1060,1000,1439,1198,1427.1001)
# - numbers close to 1000 are expected to occur frequently. configurations
# should be generated with an uniform distribution pattern across iterations.
rand_ranges placement_type=random replication_factor=3 range_gen_type=uniform keyspace_gen_type=zipf
----

eval duration=5m num_iterations=10 verbose=(test_settings,config_gen)
----
test settings
	num_iterations=10 duration=5m0s
----------------------------------
generating cluster configurations using randomized option
	cluster_gen_type=single_region
generating ranges configurations using randomized option
	placement_type=random, range_gen_type=uniform, key_space=zipf, replication_factor=3, weightedRand=[]
generating load configurations using static option
	rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=1, max_key=200000, skewed_access=false
generating events configurations using static option
generating settings configurations using static option
----------------------------------
sample1: start running
configurations generated using seed 1926012586526624009
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=305, key_space=1015, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample1: pass
----------------------------------
sample2: start running
configurations generated using seed 2643318057788968173
	loaded cluster with
 		region:US [zone=US_1(nodes=5,stores=1), zone=US_2(nodes=5,stores=1), zone=US_3(nodes=5,stores=1)]
	randomized ranges with placement_type=random, ranges=944, key_space=1357, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample2: pass
----------------------------------
sample3: start running
configurations generated using seed 6972490225919430754
	loaded cluster with
 		region:US [zone=US_1(nodes=5,stores=1), zone=US_2(nodes=5,stores=1), zone=US_3(nodes=5,stores=1)]
	randomized ranges with placement_type=random, ranges=479, key_space=1003, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample3: pass
----------------------------------
sample4: start running
configurations generated using seed 8427801741804500990
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=487, key_space=2171, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample4: pass
----------------------------------
sample5: start running
configurations generated using seed 8063729658764635782
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=285, key_space=1060, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample5: pass
----------------------------------
sample6: start running
configurations generated using seed 3814222400681984302
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=611, key_space=1000, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample6: pass
----------------------------------
sample7: start running
configurations generated using seed 13013938835543503
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=271, key_space=1439, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample7: pass
----------------------------------
sample8: start running
configurations generated using seed 2207144605302255518
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=502, key_space=1198, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample8: pass
----------------------------------
sample9: start running
configurations generated using seed 5888461606762344739
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=865, key_space=1427, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample9: pass
----------------------------------
sample10: start running
configurations generated using seed 6738330972202035110
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=787, key_space=1001, replication_factor=3, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample10: pass
----------------------------------

clear
----

# We expect ranges to be randomly allocated across stores with a replication
# factor of 1.
rand_cluster cluster_gen_type=single_region
----

rand_ranges placement_type=random replication_factor=1
----

eval duration=20m num_iterations=3 verbose=(test_settings,config_gen)
----
test settings
	num_iterations=3 duration=20m0s
----------------------------------
generating cluster configurations using randomized option
	cluster_gen_type=single_region
generating ranges configurations using randomized option
	placement_type=random, range_gen_type=uniform, key_space=uniform, replication_factor=1, weightedRand=[]
generating load configurations using static option
	rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=1, max_key=200000, skewed_access=false
generating events configurations using static option
generating settings configurations using static option
----------------------------------
sample1: start running
configurations generated using seed 1926012586526624009
	loaded cluster with
 		region:US [zone=US_1(nodes=1,stores=5), zone=US_2(nodes=1,stores=5), zone=US_3(nodes=1,stores=5)]
	randomized ranges with placement_type=random, ranges=305, key_space=96760, replication_factor=1, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample1: pass
----------------------------------
sample2: start running
configurations generated using seed 2643318057788968173
	loaded cluster with
 		region:US [zone=US_1(nodes=5,stores=1), zone=US_2(nodes=5,stores=1), zone=US_3(nodes=5,stores=1)]
	randomized ranges with placement_type=random, ranges=944, key_space=150098, replication_factor=1, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample2: pass
----------------------------------
sample3: start running
configurations generated using seed 6972490225919430754
	loaded cluster with
 		region:US [zone=US_1(nodes=5,stores=1), zone=US_2(nodes=5,stores=1), zone=US_3(nodes=5,stores=1)]
	randomized ranges with placement_type=random, ranges=479, key_space=199954, replication_factor=1, bytes=0
	basic load with rw_ratio=0.00, rate=0.00, skewed_access=false, min_block_size=1, max_block_size=1, min_key=1, max_key=200000
	number of mutation events=0, number of assertion events=0
sample3: pass
----------------------------------
