Skip to content

Commit 0ebff01

Browse files
horigutihackorum
authored andcommitted
Wait for process termination during isolation tests
slot_creation_error.spec and temp-schema-cleanup.spec used pg_terminate_backend() without specifying timeout, thus there may be a case of proceeding to the next step before the process actually terminates then false failure. Supply timeout to pg_terminate_backend() so that it waits for process termination to avoid that failure mode.
1 parent d29d469 commit 0ebff01

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

contrib/test_decoding/expected/slot_creation_error.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ step s2_init:
8888
SELECT 'init' FROM pg_create_logical_replication_slot('slot_creation_error', 'test_decoding');
8989
<waiting ...>
9090
step s1_terminate_s2:
91-
SELECT pg_terminate_backend(pid)
91+
SELECT pg_terminate_backend(pid, 180000)
9292
FROM pg_stat_activity
9393
WHERE application_name = 'isolation/slot_creation_error/s2';
9494
<waiting ...>

contrib/test_decoding/specs/slot_creation_error.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ step s1_cancel_s2 {
1313
}
1414

1515
step s1_terminate_s2 {
16-
SELECT pg_terminate_backend(pid)
16+
SELECT pg_terminate_backend(pid, 180000)
1717
FROM pg_stat_activity
1818
WHERE application_name = 'isolation/slot_creation_error/s2';
1919
}

src/test/isolation/expected/temp-schema-cleanup.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exec
8787
s1: NOTICE: function "uses_a_temp_type" will be effectively temporary
8888
DETAIL: It depends on temporary type just_give_me_a_type.
8989
step s1_exit:
90-
SELECT pg_terminate_backend(pg_backend_pid());
90+
SELECT pg_terminate_backend(pg_backend_pid(), 180000);
9191

9292
FATAL: terminating connection due to administrator command
9393
server closed the connection unexpectedly

src/test/isolation/specs/temp-schema-cleanup.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ step s1_discard_temp {
4747
}
4848

4949
step s1_exit {
50-
SELECT pg_terminate_backend(pg_backend_pid());
50+
SELECT pg_terminate_backend(pg_backend_pid(), 180000);
5151
}
5252

5353

0 commit comments

Comments
 (0)