aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration
diff options
context:
space:
mode:
authorGravatar ruperts <ruperts@google.com>2018-06-19 15:44:13 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-19 15:45:37 -0700
commitd83771aac53d5bc6f98e02538d21acf31fd17a0e (patch)
tree4b0696948bcbcbb5e171e60a6f81af602d0a38f7 /src/test/shell/integration
parenta0e8aae4b30a23d6a3069c343a47cd56b5ed3809 (diff)
Be more generous with user time and system time bounds for execution statistics tests, and increase granularity of the waits.
RELNOTES: None. PiperOrigin-RevId: 201254824
Diffstat (limited to 'src/test/shell/integration')
-rwxr-xr-xsrc/test/shell/integration/linux-sandbox_test.sh6
-rwxr-xr-xsrc/test/shell/integration/process-wrapper_test.sh6
-rw-r--r--src/test/shell/integration/spend_cpu_time.cc4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/test/shell/integration/linux-sandbox_test.sh b/src/test/shell/integration/linux-sandbox_test.sh
index f7ea4dca77..7352ab9d72 100755
--- a/src/test/shell/integration/linux-sandbox_test.sh
+++ b/src/test/shell/integration/linux-sandbox_test.sh
@@ -261,15 +261,15 @@ function assert_linux_sandbox_exec_time() {
}
function test_stats_high_user_time() {
- assert_linux_sandbox_exec_time 10 12 0 2
+ assert_linux_sandbox_exec_time 6 11 0 5
}
function test_stats_high_system_time() {
- assert_linux_sandbox_exec_time 0 2 10 12
+ assert_linux_sandbox_exec_time 0 5 6 11
}
function test_stats_high_user_time_and_high_system_time() {
- assert_linux_sandbox_exec_time 10 12 10 12
+ assert_linux_sandbox_exec_time 6 11 6 11
}
# The test shouldn't fail if the environment doesn't support running it.
diff --git a/src/test/shell/integration/process-wrapper_test.sh b/src/test/shell/integration/process-wrapper_test.sh
index ee4732ac27..1d04606a08 100755
--- a/src/test/shell/integration/process-wrapper_test.sh
+++ b/src/test/shell/integration/process-wrapper_test.sh
@@ -150,15 +150,15 @@ function assert_process_wrapper_exec_time() {
}
function test_stats_high_user_time() {
- assert_process_wrapper_exec_time 10 12 0 2
+ assert_process_wrapper_exec_time 6 11 0 5
}
function test_stats_high_system_time() {
- assert_process_wrapper_exec_time 0 2 10 12
+ assert_process_wrapper_exec_time 0 5 6 11
}
function test_stats_high_user_time_and_high_system_time() {
- assert_process_wrapper_exec_time 10 12 10 12
+ assert_process_wrapper_exec_time 6 11 6 11
}
run_suite "process-wrapper"
diff --git a/src/test/shell/integration/spend_cpu_time.cc b/src/test/shell/integration/spend_cpu_time.cc
index 636a2a1692..cc0acfaaf5 100644
--- a/src/test/shell/integration/spend_cpu_time.cc
+++ b/src/test/shell/integration/spend_cpu_time.cc
@@ -31,7 +31,7 @@ static void WasteUserTime() {
volatile_counter = 0;
while (true) {
volatile_counter++;
- if (volatile_counter == 10000000) {
+ if (volatile_counter == 1000) {
break;
}
}
@@ -50,7 +50,7 @@ static void WasteSystemTime() {
err(EXIT_FAILURE, "chdir() failed");
}
volatile_counter++;
- if (volatile_counter == 100000) {
+ if (volatile_counter == 1000) {
break;
}
}