Commit 93f4146
committed
Simplify tests of postgres_fdw terminating connections
The tests introduced in 32a9c0b for connections broken and
re-established rely on pg_terminate_backend() for their logic. When
these were introduced, this function simply sent a signal to a backend
without waiting for the operation to complete, and the tests repeatedly
looked at pg_stat_activity to check if the operation was completed or
not. Since aaf0432, it is possible to define a timeout to make
pg_terminate_backend() wait for a certain duration, so make use of it,
with a timeout reasonably large enough (3min) to give enough room for
the tests to pass even on slow machines.
Some measurements show that the tests of postgres_fdw are much faster
with this change. For example, on my laptop, they now take 4s instead
of 6s.
Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACXGY_EfGrMTjKjHy2zi-u1u9rdeioU_fro0T6Jo8t56KQ@mail.gmail.com1 parent cca57c1 commit 93f4146
File tree
2 files changed
+22
-38
lines changed- contrib/postgres_fdw
- expected
- sql
2 files changed
+22
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9195 | 9195 | | |
9196 | 9196 | | |
9197 | 9197 | | |
9198 | | - | |
9199 | | - | |
9200 | | - | |
9201 | | - | |
9202 | | - | |
9203 | | - | |
9204 | | - | |
9205 | | - | |
9206 | | - | |
9207 | | - | |
9208 | | - | |
9209 | | - | |
9210 | | - | |
9211 | 9198 | | |
9212 | 9199 | | |
9213 | 9200 | | |
| |||
9217 | 9204 | | |
9218 | 9205 | | |
9219 | 9206 | | |
9220 | | - | |
9221 | | - | |
| 9207 | + | |
| 9208 | + | |
| 9209 | + | |
| 9210 | + | |
| 9211 | + | |
| 9212 | + | |
| 9213 | + | |
| 9214 | + | |
9222 | 9215 | | |
9223 | 9216 | | |
9224 | 9217 | | |
| |||
9231 | 9224 | | |
9232 | 9225 | | |
9233 | 9226 | | |
9234 | | - | |
| 9227 | + | |
| 9228 | + | |
| 9229 | + | |
| 9230 | + | |
| 9231 | + | |
| 9232 | + | |
| 9233 | + | |
| 9234 | + | |
9235 | 9235 | | |
9236 | 9236 | | |
9237 | 9237 | | |
9238 | 9238 | | |
9239 | 9239 | | |
9240 | 9240 | | |
9241 | | - | |
9242 | | - | |
9243 | 9241 | | |
9244 | 9242 | | |
9245 | 9243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2786 | 2786 | | |
2787 | 2787 | | |
2788 | 2788 | | |
2789 | | - | |
2790 | | - | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
2795 | | - | |
2796 | | - | |
2797 | | - | |
2798 | | - | |
2799 | | - | |
2800 | | - | |
2801 | | - | |
2802 | | - | |
2803 | 2789 | | |
2804 | 2790 | | |
2805 | 2791 | | |
2806 | 2792 | | |
2807 | 2793 | | |
2808 | | - | |
2809 | | - | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
2810 | 2797 | | |
2811 | 2798 | | |
2812 | 2799 | | |
| |||
2816 | 2803 | | |
2817 | 2804 | | |
2818 | 2805 | | |
2819 | | - | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
2820 | 2809 | | |
2821 | 2810 | | |
2822 | 2811 | | |
2823 | 2812 | | |
2824 | 2813 | | |
2825 | 2814 | | |
2826 | | - | |
2827 | | - | |
2828 | | - | |
2829 | 2815 | | |
2830 | 2816 | | |
2831 | 2817 | | |
| |||
0 commit comments