Skip to content

Commit cc75f5b

Browse files
committed
added wait time
1 parent c37aa24 commit cc75f5b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/scripts/windows/test_task.bat

+16-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,23 @@ echo create user %PDO_FIREBIRD_TEST_USER% password '%PDO_FIREBIRD_TEST_PASS%';>
6565
echo commit;>> C:\Firebird\setup.sql
6666
echo create database '%PDO_FIREBIRD_TEST_DATABASE%' user '%PDO_FIREBIRD_TEST_USER%' password '%PDO_FIREBIRD_TEST_PASS%';>> C:\Firebird\setup.sql
6767
C:\Firebird\instsvc.exe install -n TestInstance
68-
C:\Firebird\isql -q -i C:\Firebird\setup.sql
6968
C:\Firebird\instsvc.exe start -n TestInstance
69+
rem wait for Firebird to start
70+
set WAIT_COUNT=0
71+
:waitloop
72+
for /f "tokens=3" %%s in ('sc query TestInstance ^| findstr STATE') do (
73+
if "%%s"=="RUNNING" goto :isqlstart
74+
)
75+
set /a WAIT_COUNT+=1
76+
if !WAIT_COUNT! geq !MAX_WAIT! (
77+
echo Firebird service did not start within 20 seconds.
78+
exit /b 3
79+
)
80+
ping -n 2 127.0.0.1 >nul
81+
goto :waitloop
82+
rem setup Firebird
83+
:isqlstart
84+
C:\Firebird\isql -q -i C:\Firebird\setup.sql
7085
if %errorlevel% neq 0 exit /b 3
7186
path C:\Firebird;%PATH%
7287

0 commit comments

Comments
 (0)