From ce90fc04574e5773574cb69fbe34f21ea34da661 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 9 Jun 2016 09:57:29 -0400
Subject: [PATCH] Add Solr sleep setting.

---
 build.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/build.xml b/build.xml
index 42fd49f9e2c..baba82f0901 100644
--- a/build.xml
+++ b/build.xml
@@ -23,6 +23,7 @@
   <property name="composer_extra_params" value="" />
   <property name="mink_driver" value="selenium" />
   <property name="snooze_multiplier" value="1" /><!-- can be used to slow down tests (selenium only) -->
+  <property name="solr_startup_sleep" value="0" />
   <property name="php-cs-fixers" value="no_blank_lines_before_namespaces,function_call_space,trailing_spaces,unused_use,lowercase_keywords,encoding,parenthesis,php_closing_tag,visibility,duplicate_semicolon,extra_empty_lines,no_blank_lines_after_class_opening,no_empty_lines_after_phpdocs,operators_spaces,spaces_before_semicolon,ternary_spaces,concat_with_spaces,short_array_syntax,phpdoc_no_access,remove_leading_slash_use,eof_ending" />
 
 
@@ -199,6 +200,17 @@
     <exec command="VUFIND_HOME=${srcdir} ${srcdir}/solr.sh restart" outputProperty="LASTOUTPUT" />
     <echo message="${LASTOUTPUT}" />
 
+    <if>
+      <equals arg1="0" arg2="${solr_startup_sleep}" />
+      <then>
+        <!-- do nothing -->
+      </then>
+      <else>
+        <echo message="Waiting ${solr_startup_sleep} seconds for Solr to be ready..." />
+        <exec command="sleep ${solr_startup_sleep}" />
+      </else>
+    </if>
+
     <!-- import marc test records into vufind index (note: the marc test records have prefix "testsample#") -->
     <exec escape="false" command="find ${srcdir}/tests/data -name '*.mrc' -printf '%p,'" outputProperty="buglist" />
     <foreach list="${buglist}" param="filename" delimiter="," target="importrec" />
-- 
GitLab