Assign a random testing port.

That fixes below error as much as possible.
https://github.com/ged/ruby-pg/pull/39
This commit is contained in:
Jun Aruga 2019-05-15 15:53:29 +02:00
parent d508830cf5
commit 397796ed6e

View File

@ -80,7 +80,9 @@ done
pushd .%{gem_instdir} pushd .%{gem_instdir}
# Set --verbose to show detail log by $VERBOSE. # Set --verbose to show detail log by $VERBOSE.
# See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE # See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE
if ! ruby -S --verbose \ # Assign a random port to consider a case of multi builds in parallel in a host.
# https://github.com/ged/ruby-pg/pull/39
if ! PGPORT="$((54321 + ${RANDOM} % 1000))" ruby -S --verbose \
rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec; then rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec; then
echo "==== [setup.log start ] ====" echo "==== [setup.log start ] ===="
cat tmp_test_specs/setup.log cat tmp_test_specs/setup.log