mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-09 10:38:10 -06:00
Fixed racy test: wait for the server to stop after being killed when we have async pushes turned on
This commit is contained in:
@@ -170,10 +170,20 @@ start_multi_db_server() {
|
||||
wait_for_connection $PORT 5000
|
||||
}
|
||||
|
||||
# stop_sql_server stops the SQL server. For cases where it's important
|
||||
# to wait for the process to exit after the kill signal (e.g. waiting
|
||||
# for an async replication push), pass 1.
|
||||
stop_sql_server() {
|
||||
wait=$1
|
||||
if [ ! -z "$SERVER_PID" ]; then
|
||||
kill $SERVER_PID
|
||||
fi
|
||||
if [ $wait ]; then
|
||||
while ps -p $SERVER_PID > /dev/null; do
|
||||
sleep .1;
|
||||
done
|
||||
fi;
|
||||
|
||||
SERVER_PID=
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ teardown() {
|
||||
multi_query repo1 1 "
|
||||
SELECT DOLT_COMMIT('-am', 'Step 1');"
|
||||
|
||||
# threads guaranteed to flush after we stop server
|
||||
stop_sql_server
|
||||
# wait for the process to exit after we stop it
|
||||
stop_sql_server 1
|
||||
|
||||
cd ../repo2
|
||||
dolt pull remote1
|
||||
@@ -255,3 +255,13 @@ teardown() {
|
||||
server_query "repo2/feature-branch" 1 "SHOW Tables" "Table\ntest"
|
||||
}
|
||||
|
||||
@test "remotes-sql-server: connect to hash works" {
|
||||
skiponwindows "Has dependencies that are missing on the Jenkins Windows installation."
|
||||
|
||||
cd repo1
|
||||
head_hash=$(get_head_commit)
|
||||
}
|
||||
|
||||
get_head_commit() {
|
||||
dolt log -n 1 | grep -m 1 commit | cut -c 13-44
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user