On 2023-07-04 Tu 16:54, Daniel Gustafsson wrote:
On 4 Jul 2023, at 20:19, Andrew Dunstan<and...@dunslane.net> wrote:
But sadly we're kinda back where we started. fairywren is failing on REL_16_STABLE.
Before the changes the failure occurred because the test script was unable to create
the file with a path > 255. Now that we have a way to create the file the test for
pg_basebackup to reject files with names > 100 fails, I presume because the server
can't actually see the file. At this stage I'm thinking the best thing would be to
skip the test altogether on windows if the path is longer than 255.
That does sound like a fairly large hammer for a nail small enough that we
should be able to fix it, but I don't have any other good ideas off the cuff.
Not sure it's such a big hammer. Here's a patch.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index e0009c8531..ee0d03512c 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -311,20 +311,22 @@ $node->command_fails(
'-T with invalid format fails');
# Tar format doesn't support filenames longer than 100 bytes.
-# Create the test file via a short name directory so it doesn't blow the
-# Windows path limit.
-my $lftmp = PostgreSQL::Test::Utils::tempdir_short;
-dir_symlink "$pgdata", "$lftmp/pgdata";
-my $superlongname = "superlongname_" . ("x" x 100);
-my $superlongpath = "$lftmp/pgdata/$superlongname";
+SKIP:
+{
+ my $superlongname = "superlongname_" . ("x" x 100);
+ my $superlongpath = "$pgdata/$superlongname";
-open my $file, '>', "$superlongpath"
- or die "unable to create file $superlongpath";
-close $file;
-$node->command_fails(
- [ @pg_basebackup_defs, '-D', "$tempdir/tarbackup_l1", '-Ft' ],
- 'pg_basebackup tar with long name fails');
-unlink "$superlongpath";
+ skip "File path too long", 1
+ if $windows_os && length($superlongpath) > 255;
+
+ open my $file, '>', "$superlongpath"
+ or die "unable to create file $superlongpath";
+ close $file;
+ $node->command_fails(
+ [ @pg_basebackup_defs, '-D', "$tempdir/tarbackup_l1", '-Ft' ],
+ 'pg_basebackup tar with long name fails');
+ unlink "$superlongpath";
+}
# The following tests are for symlinks.