--- a/src/test/modules/test_cloexec/t/001_cloexec.pl
+++ b/src/test/modules/test_cloexec/t/001_cloexec.pl
@@ -19,3 +19,3 @@ if (!$PostgreSQL::Test::Utils::windows_os)

-plan tests => 1;
+plan tests => 1000;

@@ -44,2 +44,4 @@ note("Using test program: $test_prog");

+for (my $i = 1; $i <= 1000; $i++)
+{
  my ($stdout, $stderr);
@@ -58,3 +60,3 @@ ok($result && $stdout =~ /SUCCESS.*O_CLOEXEC behavior verified/s,
     "O_CLOEXEC prevents handle inheritance");
-
+}
  done_testing();
