|
10 | 10 | use TestLib;
|
11 | 11 | use Time::HiRes qw(usleep);
|
12 | 12 |
|
13 |
| -plan tests => 5; |
| 13 | +if ($windows_os) |
| 14 | +{ |
| 15 | + plan skip_all => 'SysV shared memory not supported by this platform'; |
| 16 | +} |
| 17 | +else |
| 18 | +{ |
| 19 | + plan tests => 5; |
| 20 | +} |
14 | 21 |
|
15 | 22 | my $tempdir = TestLib::tempdir;
|
16 | 23 | my $port;
|
@@ -124,7 +131,7 @@ sub init_start
|
124 | 131 | "SELECT pid FROM pg_stat_activity WHERE query = '$slow_query'");
|
125 | 132 | $gnat->kill9;
|
126 | 133 | unlink($gnat->data_dir . '/postmaster.pid');
|
127 |
| -$gnat->rotate_logfile; # on Windows, can't open old log for writing |
| 134 | +$gnat->rotate_logfile; |
128 | 135 | log_ipcs();
|
129 | 136 | # Reject ordinary startup. Retry for the same reasons poll_start() does.
|
130 | 137 | my $pre_existing_msg = qr/pre-existing shared memory block/;
|
@@ -153,13 +160,10 @@ sub init_start
|
153 | 160 | 'single-user mode detected live backend via shared memory');
|
154 | 161 | log_ipcs();
|
155 | 162 | # Fail to reject startup if shm key N has become available and we crash while
|
156 |
| -# using key N+1. This is unwanted, but expected. Windows is immune, because |
157 |
| -# its GetSharedMemName() use DataDir strings, not numeric keys. |
| 163 | +# using key N+1. This is unwanted, but expected. |
158 | 164 | $flea->stop; # release first key
|
159 |
| -is( $gnat->start(fail_ok => 1), |
160 |
| - $TestLib::windows_os ? 0 : 1, |
161 |
| - 'key turnover fools only sysv_shmem.c'); |
162 |
| -$gnat->stop; # release first key (no-op on $TestLib::windows_os) |
| 165 | +is($gnat->start(fail_ok => 1), 1, 'key turnover fools only sysv_shmem.c'); |
| 166 | +$gnat->stop; # release first key |
163 | 167 | $flea->start; # grab first key
|
164 | 168 | # cleanup
|
165 | 169 | TestLib::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid);
|
|
0 commit comments