diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index 079321bbfc..dc0f772834 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -233,6 +233,22 @@ sub test_access
 
 		like($first_logfile, qr/\Q$expect_log_msg\E/,
 			 'found expected log file content');
+
+		# Rotate to a new file, for any next check.  Note that
+		# pg_ctl does not wait for the operation to complete
+		# so wait for the result to change first.  Sleep a bit
+		# to have a new log file name.
+		sleep(2);
+		$node->logrotate;
+		my $new_current_logfiles;
+
+		# Wait until the contents of current_logfiles have changed.
+		for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
+		{
+			$new_current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
+			last if $new_current_logfiles ne $current_logfiles;
+			usleep(100_000);
+		}
 	}
 
 	return;
