From 8744b88cade5ab60671c7f564c019df86020eb23 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sat, 22 Dec 2018 20:11:34 +0300 Subject: [PATCH] Return a non-zero exit code on event queue overflow in the --rate mode. --- src/sysbench.c | 1 + tests/t/opt_rate.t | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/t/opt_rate.t diff --git a/src/sysbench.c b/src/sysbench.c index 96121aa..0d32614 100644 --- a/src/sysbench.c +++ b/src/sysbench.c @@ -918,6 +918,7 @@ static void *eventgen_thread_proc(void *arg) log_text(LOG_FATAL, "The event queue is full. This means the worker threads are " "unable to keep up with the specified event generation rate"); + sb_globals.error = 1; return NULL; } diff --git a/tests/t/opt_rate.t b/tests/t/opt_rate.t new file mode 100644 index 0000000..24448de --- /dev/null +++ b/tests/t/opt_rate.t @@ -0,0 +1,8 @@ +######################################################################## +Tests for the --rate option (aka the limited rate mode) +######################################################################## + +# Failing to deliver the requested rate should result in a non-zero exit code + $ sysbench --rate=2000000000 cpu run --verbosity=1 + FATAL: The event queue is full. This means the worker threads are unable to keep up with the specified event generation rate + [1]