Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9685d73

Browse files
committed
Fix issues with TAP tests of pg_verify_checksums
Two issues have been spotted and get fixed here:- When checking for corrupted files, make sure that pg_verify_checksumscomplains about the correct file. In order to make the logic morerobust, all files created are immediately removed once checks on themare done. The error message generated by pg_verify_checksums also nowincludes the file name it sees as corrupted.- Before running corruption-related tests, empty files are generatedwhich used names mapping with the corrupted files, potentially leadingto conflicts. So use different set of names for both.Author: Michael BanckDiscussion:https://postgr.es/m/20181119181119.GC23740@nighthawk.caipicrew.dd-dns.de
1 parentcb09903 commit9685d73

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

‎src/bin/pg_verify_checksums/t/002_actions.pl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,28 @@ sub fail_corrupt
104104
my$pgdata =$node->data_dir;
105105

106106
# Create the file with some dummy data in it.
107-
append_to_file"$pgdata/global/$file","foo";
107+
my$file_name ="$pgdata/global/$file";
108+
append_to_file$file_name,"foo";
108109

109110
$node->command_checks_all(['pg_verify_checksums','-D',$pgdata],
110111
1,
111112
[qr/^$/],
112-
[qr/could not read block/],
113+
[qr/could not read block 0 in file.*$file\":/],
113114
"fails for corrupted data in$file");
114115

116+
# Remove file to prevent future lookup errors on conflicts.
117+
unlink$file_name;
115118
return;
116119
}
117120

118121
# Authorized relation files filled with corrupted data cause the
119-
# checksum checks to fail.
120-
fail_corrupt($node,"99999");
121-
fail_corrupt($node,"99999.123");
122-
fail_corrupt($node,"99999_fsm");
123-
fail_corrupt($node,"99999_init");
124-
fail_corrupt($node,"99999_vm");
125-
fail_corrupt($node,"99999_init.123");
126-
fail_corrupt($node,"99999_fsm.123");
127-
fail_corrupt($node,"99999_vm.123");
122+
# checksum checks to fail. Make sure to use file names different
123+
# than the previous ones.
124+
fail_corrupt($node,"99990");
125+
fail_corrupt($node,"99990.123");
126+
fail_corrupt($node,"99990_fsm");
127+
fail_corrupt($node,"99990_init");
128+
fail_corrupt($node,"99990_vm");
129+
fail_corrupt($node,"99990_init.123");
130+
fail_corrupt($node,"99990_fsm.123");
131+
fail_corrupt($node,"99990_vm.123");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp