From 85554087d1a062a9381e7dbe9807f746723e6985 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Fri, 19 Apr 2019 15:46:39 -0700 Subject: [PATCH] treat negatives like zero instead of crashing out (#3899) --- bench-tps/src/bench.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bench-tps/src/bench.rs b/bench-tps/src/bench.rs index 4fab83f6d..412d716d0 100644 --- a/bench-tps/src/bench.rs +++ b/bench-tps/src/bench.rs @@ -221,13 +221,14 @@ fn sample_tx_count( let log_prefix = format!("{:21}:", client.transactions_addr()); loop { - let tx_count = client.get_transaction_count().expect("transaction count"); - assert!( - tx_count >= initial_tx_count, - "expected tx_count({}) >= initial_tx_count({})", - tx_count, - initial_tx_count - ); + let mut tx_count = client.get_transaction_count().expect("transaction count"); + if tx_count < initial_tx_count { + println!( + "expected tx_count({}) >= initial_tx_count({})", + tx_count, initial_tx_count + ); + tx_count = initial_tx_count; + } let duration = now.elapsed(); now = Instant::now(); let sample = tx_count - initial_tx_count;