Assign a random testing port

That fixes below error as much as possible. (The example is for rubygem-pg)
https://src.fedoraproject.org/rpms/rubygem-pg/pull-request/3
Related: rhbz#1688758
This commit is contained in:
Jun Aruga 2019-05-21 19:39:12 +02:00
parent d4842d825f
commit cd84930864
1 changed files with 3 additions and 1 deletions

View File

@ -97,7 +97,9 @@ pushd .%{gem_instdir}
TOP_DIR=$(pwd)
# Use testing port because the standard mysqld port 3306 is occupied.
MYSQL_TEST_PORT="13306"
# Assign a random port to consider a case of multi builds in parallel in a host.
# https://src.fedoraproject.org/rpms/rubygem-pg/pull-request/3
MYSQL_TEST_PORT="$((13306 + ${RANDOM} % 1000))"
MYSQL_TEST_USER=$(id -un)
MYSQL_TEST_DATA_DIR="${TOP_DIR}/data"
MYSQL_TEST_SOCKET="${TOP_DIR}/mysql.sock"