From 397796ed6ed7ab84cc184f185d41fb3da13fc31c Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 15 May 2019 15:53:29 +0200 Subject: [PATCH] Assign a random testing port. That fixes below error as much as possible. https://github.com/ged/ruby-pg/pull/39 --- rubygem-pg.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rubygem-pg.spec b/rubygem-pg.spec index a0224a9..91f39a3 100644 --- a/rubygem-pg.spec +++ b/rubygem-pg.spec @@ -80,7 +80,9 @@ done pushd .%{gem_instdir} # Set --verbose to show detail log by $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 echo "==== [setup.log start ] ====" cat tmp_test_specs/setup.log