Skip to content

Commit

Permalink
fix: fix key generation rule in integration test (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCroxx authored May 9, 2022
1 parent 98d8e44 commit 1db1300
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions tests/integrations/test_concurrent_put_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const WHEEL_CONFIG_PATH: &str = "etc/wheel.toml";
const EXHAUSTER_CONFIG_PATH: &str = "etc/exhauster.toml";
const LSM_TREE_CONFIG_PATH: &str = "etc/lsm_tree.toml";

const CONCURRENCY: u64 = 1000;
const LOOP: u64 = 3;

async fn add_key_range(
wheel_client: &mut WheelServiceClient<Channel>,
start: &[u8],
Expand Down Expand Up @@ -168,12 +171,11 @@ async fn test_concurrent_put_get() {
.await
.unwrap();

let futures = (0..1000)
.map(|c| {
let futures = (0..CONCURRENCY)
.map(|i| {
let channel_clone = channel.clone();
async move {
for t in 0..1 {
let i = t + c;
for _ in 0..LOOP {
let mut rng = thread_rng();
let channel_clone_clone = channel_clone.clone();
let mut client = KvServiceClient::new(channel_clone_clone);
Expand Down
10 changes: 6 additions & 4 deletions tests/integrations/test_multi_raft_group_concurrent_put_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const WHEEL_CONFIG_PATH: &str = "etc/wheel.toml";
const EXHAUSTER_CONFIG_PATH: &str = "etc/exhauster.toml";
const LSM_TREE_CONFIG_PATH: &str = "etc/lsm_tree.toml";

const CONCURRENCY: u64 = 1000;
const LOOP: u64 = 3;

async fn add_key_range(
wheel_client: &mut WheelServiceClient<Channel>,
start: &[u8],
Expand Down Expand Up @@ -179,12 +182,11 @@ async fn test_multi_raft_group_concurrent_put_get() {
.await
.unwrap();

let futures = (0..1000)
.map(|c| {
let futures = (0..CONCURRENCY)
.map(|i| {
let channel_clone = channel.clone();
async move {
for t in 0..1 {
let i = t + c;
for _ in 0..LOOP {
let mut rng = thread_rng();
let channel_clone_clone = channel_clone.clone();
let mut client = KvServiceClient::new(channel_clone_clone);
Expand Down

0 comments on commit 1db1300

Please sign in to comment.