@@ -721,6 +721,17 @@ def test_concurrent_detach(self):
721721inserts_advance = 1 # abvance in sec of inserts process under detachs
722722test_interval = int (math .ceil (detach_timeout * num_detachs ))
723723
724+ insert_pgbench_script = os .path .dirname (os .path .realpath (__file__ )) \
725+ + "/pgbench_scripts/insert_current_timestamp.pgbench"
726+ detach_pgbench_script = os .path .dirname (os .path .realpath (__file__ )) \
727+ + "/pgbench_scripts/detachs_in_timeout.pgbench"
728+
729+ # Check pgbench scripts on existance
730+ self .assertTrue (os .path .isfile (insert_pgbench_script ),
731+ msg = "pgbench script with insert timestamp doesn't exist" )
732+ self .assertTrue (os .path .isfile (detach_pgbench_script ),
733+ msg = "pgbench script with detach letfmost partition doesn't exist" )
734+
724735# Create and start new instance
725736node = self .start_new_pathman_cluster (allows_streaming = False )
726737
@@ -733,16 +744,21 @@ def test_concurrent_detach(self):
733744
734745# Run in background inserts and detachs processes
735746FNULL = open (os .devnull ,'w' )
747+
748+ # init pgbench's utility tables
749+ init_pgbench = node .pgbench (stdout = FNULL ,stderr = FNULL ,options = ["-i" ])
750+ init_pgbench .wait ()
751+
736752inserts = node .pgbench (stdout = FNULL ,stderr = subprocess .PIPE ,options = [
737753"-j" ,"%i" % num_insert_workers ,
738754"-c" ,"%i" % num_insert_workers ,
739- "-f" ,"pgbench_scripts/insert_current_timestamp.pgbench" ,
755+ "-f" ,insert_pgbench_script ,
740756"-T" ,"%i" % (test_interval + inserts_advance )
741757])
742758time .sleep (inserts_advance )
743759detachs = node .pgbench (stdout = FNULL ,stderr = subprocess .PIPE ,options = [
744760"-D" ,"timeout=%f" % detach_timeout ,
745- "-f" ,"pgbench_scripts/detachs_in_timeout.pgbench" ,
761+ "-f" ,detach_pgbench_script ,
746762"-T" ,"%i" % test_interval
747763])
748764
@@ -752,10 +768,8 @@ def test_concurrent_detach(self):
752768
753769# Obtain error log from inserts process
754770inserts_errors = inserts .stderr .read ()
755-
756- self .assertIsNone (
757- re .search ("ERROR: constraint" ,inserts_errors ),
758- msg = "Race condition between detach and concurrent inserts with append partition is expired" )
771+ self .assertIsNone (re .search ("ERROR|FATAL|PANIC" ,inserts_errors ),
772+ msg = "Race condition between detach and concurrent inserts with append partition is expired" )
759773
760774# Stop instance and finish work
761775node .stop ()