]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Disable progress indicator in grub-shell.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 5 Jan 2016 11:47:30 +0000 (12:47 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 5 Jan 2016 20:10:10 +0000 (21:10 +0100)
This disables progress indicator for tests. This in turn fixes test
flakiness as they ended up timing-dependent.

grub-core/lib/progress.c
tests/util/grub-shell.in

index 95a4a62816e9adaf9ffafc90630a31cf406f6cd6..4b7cbbca6ddce81071584207d74868ee91a1d224 100644 (file)
@@ -38,11 +38,17 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)),
   grub_uint64_t now;
   static grub_uint64_t last_progress_update_time;
   grub_file_t file = data;
+  const char *e;
   file->progress_offset += length;
 
   if (call_depth)
     return;
 
+  e = grub_env_get ("enable_progress_indicator");
+  if (e && e[0] == '0') {
+    return;
+  }
+
   call_depth = 1;
   now = grub_get_time_ms ();
 
index 6d2b1327e97a0553306a30d4bca703bac6dedb6c..31a1f294d0dae41c3b0dc832f51bd995b32c117b 100644 (file)
@@ -289,6 +289,8 @@ fi
 cfgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
 cat <<EOF >${cfgfile}
 grubshell=yes
+enable_progress_indicator=0
+export enable_progress_indicator
 EOF