Test 002_pg_upgrade fails with olddump on Windows

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Test 002_pg_upgrade fails with olddump on Windows
Date: 2023-11-25 20:00:01
Message-ID: 60d434b9-53d9-9ea1-819b-efebdcf44e41@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

When trying to use a custom dump with the test pg_upgrade/002_pg_upgrade,
I observe the following test failure on Windows:
>meson test --suite setup
>echo create database regression>...\dump.sql
>set olddump=...\dump.sql& set oldinstall=.../tmp_install/usr/local/pgsql& meson test pg_upgrade/002_pg_upgrade

1/1 postgresql:pg_upgrade / pg_upgrade/002_pg_upgrade ERROR            11.38s   exit status 1

regress_log_002_pg_upgrade.txt contains:
...
[09:07:06.704](3.793s) ok 11 - run of pg_upgrade for new instance
...
[09:07:07.301](0.001s) not ok 15 - old and new dumps match after pg_upgrade
[09:07:07.301](0.000s) #   Failed test 'old and new dumps match after pg_upgrade'
#   at .../src/bin/pg_upgrade/t/002_pg_upgrade.pl line 452.
[09:07:07.301](0.000s) #          got: '1'
#     expected: '0'
=== diff of ...\build\testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8/dump1.sql and
...\build\testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8/dump2.sql
=== stdout ===
=== stderr ===
=== EOF ===

>dir "testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8/"
11/25/2023  09:06 AM             2,729 dump1.sql
11/25/2023  09:07 AM             2,590 dump2.sql

>diff -s "testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8\dump1.sql"
"testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8\dump2.sql"
Files testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8\dump1.sql and
testrun\pg_upgrade\002_pg_upgrade\data\tmp_test_ifk8\dump2.sql are identical

As I can see, dump1.sql contains line endings 0d 0a, while dump2.sql — 0a.

The attached patch fixes the issue for me.

Best regards,
Alexander

Attachment Content-Type Size
fix_002_pg_upgrade-with-olddump-win.patch text/x-patch 397 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2023-11-25 20:02:46 Re: Emitting JSON to file using COPY TO
Previous Message Tom Lane 2023-11-25 19:34:40 Re: New instability in stats regression test