Attached is v3 rebased on master at 8e82d6610e7. It retains the $!
detail you requested in v2 and creates the directory through the short
side of the Windows junction. There are no further test-logic changes.

Full ARM64 and x64 builds passed. The refreshed pg_basebackup suite
passed all 151 subtests on both native ARM64 and x64 under ARM64
emulation. Both runs emitted directory-cleanup warnings but passed all
assertions.

Could you take another look when you have a chance?

A separate GitHub-hosted Windows x64 build and all nine test groups
passed with all three patches applied. The pg_basebackup suite passed
all 152 subtests on the GitHub Windows x64 runner.

Best,
Harrison
From 50f90c0b0c1f28cad0f3508bbfb929d37bb7bf76 Mon Sep 17 00:00:00 2001
From: Harrison Booth <[email protected]>
Date: Mon, 12 Oct 2026 15:54:31 -0500
Subject: [PATCH v3] Fix pg_basebackup long-path test on Windows

Create the long tablespace directory through the short side of the Windows
junction. Check mkdir and report its underlying error instead of failing
later with a misleading CREATE TABLESPACE error.
---
 src/bin/pg_basebackup/t/010_pg_basebackup.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index 2442131e179..23a757b1c86 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -597,7 +597,8 @@ ok(-d "$tempdir/tbackup/tbl=spc2", 'tablespace with = sign was relocated');
 $node->safe_psql('postgres', "DROP TABLESPACE tblspc2;");
 rmtree("$tempdir/backup3");
 
-mkdir "$tempdir/$superlongname";
+mkdir "$real_sys_tempdir/$superlongname"
+  or BAIL_OUT "could not create $real_sys_tempdir/$superlongname: $!";
 $realTsDir = "$real_sys_tempdir/$superlongname";
 $node->safe_psql('postgres',
 	"CREATE TABLESPACE tblspc3 LOCATION '$realTsDir';");

Reply via email to