Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa7dab5

Browse files
author
Maksim Milyutin
committed
Fix test_concurrent_detach test
1 parent44dce6f commitfa7dab5

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

‎tests/python/partitioning_test.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,17 @@ def test_concurrent_detach(self):
721721
inserts_advance=1# abvance in sec of inserts process under detachs
722722
test_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
725736
node=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
735746
FNULL=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+
736752
inserts=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
])
742758
time.sleep(inserts_advance)
743759
detachs=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,14 +768,7 @@ def test_concurrent_detach(self):
752768

753769
# Obtain error log from inserts process
754770
inserts_errors=inserts.stderr.read()
755-
expected_errors= ('starting vacuum...ERROR: relation "pgbench_branches" does not exist\n'
756-
'(ignoring this error and continuing anyway)\n'
757-
'ERROR: relation "pgbench_tellers" does not exist\n'
758-
'(ignoring this error and continuing anyway)\n'
759-
'ERROR: relation "pgbench_history" does not exist\n'
760-
'(ignoring this error and continuing anyway)\n'
761-
'end.\n')
762-
self.assertEqual(inserts_errors,expected_errors,
771+
self.assertIsNone(re.search("ERROR|FATAL|PANIC",inserts_errors),
763772
msg="Race condition between detach and concurrent inserts with append partition is expired")
764773

765774
# Stop instance and finish work

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp