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

Commit551cc9a

Browse files
committed
Make PostgresNode::append_conf append a newline automatically.
Although the documentation for append_conf said clearly that it didn'tadd a newline, many test authors seem to have forgotten that ... or maybethey just consulted the example at the top of the POD documentation,which clearly shows adding a config entry without bothering to add atrailing newline. The worst part of that is that it works, as long asyou don't do it more than once, since the backend isn't picky aboutwhether config files end with newlines. So there's not a strong forcingfunction reminding test authors not to do it like that. Upshot is thatthis is a terribly fragile way to go about things, and there's at leastone existing test case that is demonstrably broken and not testing whatit thinks it is.Let's just make append_conf append a newline, instead; that is clearlyway safer than the old definition.I also cleaned up a few call sites that were unnecessarily ugly.(I left things alone in places where it's plausible that additionalconfig lines would need to be added someday.)Back-patch the change in append_conf itself to 9.6 where it was added,as having a definitional inconsistency between branches would obviouslybe pretty hazardous for back-patching TAP tests. The other changes arejust cosmetic and don't need to be back-patched.Discussion:https://postgr.es/m/19751.1492892376@sss.pgh.pa.us
1 parent95a2316 commit551cc9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/test/perl/PostgresNode.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ A shortcut method to append to files like pg_hba.conf and postgresql.conf.
441441
Does no validation or sanity checking. Does not reload the configuration
442442
after writing.
443443
444-
A newline isNOTautomatically appended to the string.
444+
A newline is automatically appended to the string.
445445
446446
=cut
447447

@@ -451,7 +451,7 @@ sub append_conf
451451

452452
my$conffile =$self->data_dir .'/' .$filename;
453453

454-
TestLib::append_to_file($conffile,$str);
454+
TestLib::append_to_file($conffile,$str ."\n");
455455
}
456456

457457
=pod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp