mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-26 18:59:08 -06:00
Fixed bugginess in server shutdown wait for bats
This commit is contained in:
@@ -112,15 +112,13 @@ stop_sql_server() {
|
||||
|
||||
wait=$1
|
||||
if [ ! -z "$SERVER_PID" ]; then
|
||||
serverpidinuse=$(lsof -i -P -n | grep LISTEN | grep $SERVER_PID | wc -l)
|
||||
if [ $serverpidinuse -gt 0 ]; then
|
||||
kill $SERVER_PID
|
||||
# ignore failures of kill command in the case the server is already dead
|
||||
run kill $SERVER_PID
|
||||
if [ $wait ]; then
|
||||
while ps -p $SERVER_PID > /dev/null; do
|
||||
sleep .1;
|
||||
done
|
||||
fi;
|
||||
fi
|
||||
fi
|
||||
SERVER_PID=
|
||||
}
|
||||
|
||||
@@ -82,6 +82,8 @@ teardown() {
|
||||
cd repo1
|
||||
dolt config --local --add sqlserver.global.dolt_replicate_to_remote remote1
|
||||
dolt config --local --add sqlserver.global.dolt_async_replication 1
|
||||
dolt config --local --add sqlserver.global.dolt_replicate_all_heads 1
|
||||
|
||||
start_sql_server repo1
|
||||
|
||||
dolt sql-client --use-db repo1 -P $PORT -u dolt -q "CALL DOLT_COMMIT('-am', 'Step 1');"
|
||||
@@ -91,7 +93,8 @@ teardown() {
|
||||
|
||||
cd ../repo2
|
||||
dolt pull remote1
|
||||
dolt sql -q "select * from test" -r csv
|
||||
|
||||
run dolt sql -q "select * from test" -r csv
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" =~ "pk" ]]
|
||||
[[ "${lines[1]}" =~ "0" ]]
|
||||
|
||||
@@ -723,6 +723,8 @@ SQL
|
||||
cd repo1
|
||||
dolt config --local --add sqlserver.global.dolt_replicate_to_remote remote1
|
||||
dolt config --local --add sqlserver.global.dolt_async_replication 1
|
||||
dolt config --local --add sqlserver.global.dolt_replicate_all_heads 1
|
||||
|
||||
dolt sql -q "create table t1 (a int primary key)"
|
||||
dolt sql -q "call dolt_add('.')"
|
||||
dolt sql -q "call dolt_commit('-am', 'cm')"
|
||||
|
||||
Reference in New Issue
Block a user