Fix 0 being accepted as a valid value in sky-bench

All inputs are expected to be non-zero
next
Sayan Nandan 3 years ago
parent 66e5d41302
commit 5be3041138

@ -9,6 +9,7 @@ All changes in this project will be noted in this file.
- The save operation now automatically attempts to recover on failure during termination [see [#166](https://github.com/skytable/skytable/pull/166)]
- More than one process can no longer concurrently use the same data directory, preventing any possible data corruption [see [#169](https://github.com/skytable/skytable/pull/169), [#167](https://github.com/skytable/skytable/issues/167)]
- Fixed longstanding error in `sky-bench` component that caused key collisions
- Fixed bug in `sky-bench` that allowed passing 0 for the inputs
### Additions

@ -71,6 +71,9 @@ fn main() {
None => DEFAULT_PACKET_SIZE,
_ => err!("Bad value for key/value size"),
};
if packet_size == 0 || max_queries == 0 || max_connections == 0 {
err!("All inputs must be non-zero values");
}
if let Some(cmd) = matches.subcommand_matches("testkey") {
let count = match cmd.value_of_lossy("count") {
Some(cnt) => match cnt.to_string().parse::<usize>() {

@ -59,7 +59,7 @@ macro_rules! sanity_test {
#[macro_export]
macro_rules! err {
($note:expr) => {{
eprintln!("{}", $note);
eprintln!("ERROR: {}", $note);
std::process::exit(0x100);
}};
}

Loading…
Cancel
Save