summaryrefslogtreecommitdiffstats
path: root/mysql-test/include/wait_until_no_pidfile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include/wait_until_no_pidfile.inc')
-rw-r--r--mysql-test/include/wait_until_no_pidfile.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/include/wait_until_no_pidfile.inc b/mysql-test/include/wait_until_no_pidfile.inc
new file mode 100644
index 00000000..94484005
--- /dev/null
+++ b/mysql-test/include/wait_until_no_pidfile.inc
@@ -0,0 +1,30 @@
+# Include this script after a shutdown to wait until the pid file,
+# stored in $pid_file, has disappered.
+
+#--echo $pid_file
+
+--disable_result_log
+--disable_query_log
+# Wait one minute
+let $counter= 600;
+while ($counter)
+{
+--error 0,1
+--file_exists $pid_file
+ if (!$errno)
+ {
+ dec $counter;
+ --real_sleep 0.1
+ }
+ if ($errno)
+ {
+ let $counter= 0;
+ }
+}
+if (!$errno)
+{
+ --die Pid file "$pid_file" failed to disappear
+}
+
+--enable_query_log
+--enable_result_log