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

Commit27093dd

Browse files
vbwagnerkelvich
authored andcommitted
Hide verbose output of multimaster tests into regress* logs
1 parentf204c05 commit27093dd

File tree

7 files changed

+69
-68
lines changed

7 files changed

+69
-68
lines changed

‎Cluster.pm

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ sub start
157157
foreachmy$node (@$nodes)
158158
{
159159
$node->start();
160-
diag"Starting node with connstr 'dbname=postgres port=@{[$node->port() ]} host=@{[$node->host() ]}'";
160+
note("Starting node with connstr 'dbname=postgres port=@{[$node->port() ]} host=@{[$node->host() ]}'");
161161
}
162162
}
163163

@@ -167,7 +167,7 @@ sub stopnode
167167
return 1unlessdefined$node->{_pid};
168168
$mode ='fast'unlessdefined$mode;
169169
my$name =$node->name;
170-
diag("stopping$name${mode}ly");
170+
note("stopping$name${mode}ly");
171171

172172
if ($modeeq'kill') {
173173
killtree($node->{_pid});
@@ -177,13 +177,13 @@ sub stopnode
177177
my$pgdata =$node->data_dir;
178178
my$ret = TestLib::system_log('pg_ctl','-D',$pgdata,'-m','fast','stop');
179179
my$pidfile =$node->data_dir ."/postmaster.pid";
180-
diag("unlink$pidfile");
180+
note("unlink$pidfile");
181181
unlink$pidfile;
182182
$node->{_pid} =undef;
183183
$node->_update_pid;
184184

185185
if ($ret != 0) {
186-
diag("$name failed to stop${mode}ly");
186+
note("$name failed to stop${mode}ly");
187187
return 0;
188188
}
189189

@@ -201,16 +201,16 @@ sub dumplogs
201201
my ($self) =@_;
202202
my$nodes =$self->{nodes};
203203

204-
diag("Dumping logs:");
204+
note("Dumping logs:");
205205
foreachmy$node (@$nodes) {
206-
diag("##################################################################");
207-
diag($node->{_logfile});
208-
diag("##################################################################");
206+
note("##################################################################");
207+
note($node->{_logfile});
208+
note("##################################################################");
209209
my$filename =$node->{_logfile};
210210
openmy$fh,'<',$filenameordie"error opening$filename:$!";
211211
my$data =do {local$/; <$fh> };
212-
diag($data);
213-
diag("##################################################################\n\n");
212+
note($data);
213+
note("##################################################################\n\n");
214214
}
215215
}
216216

@@ -221,7 +221,7 @@ sub stop
221221
$mode ='fast'unlessdefined$mode;
222222

223223
my$ok = 1;
224-
diag("stopping cluster${mode}ly");
224+
note("stopping cluster${mode}ly");
225225

226226
foreachmy$node (@$nodes) {
227227
if (!stopnode($node,$mode)) {
@@ -276,7 +276,7 @@ sub poll
276276
return 1;
277277
}
278278
my$tries_left =$tries -$i - 1;
279-
diag("$poller poll for$pollee failed [$tries_left tries left]");
279+
note("$poller poll for$pollee failed [$tries_left tries left]");
280280
sleep($delay);
281281
}
282282
return 0;
@@ -304,7 +304,7 @@ sub pgbench_async()
304304
-p=>$self->{nodes}->[$node]->port(),
305305
'postgres',
306306
);
307-
diag("running pgbench:" .join("",@pgbench_command));
307+
note("running pgbench:" .join("",@pgbench_command));
308308
my$handle = IPC::Run::start(\@pgbench_command,$in,$out);
309309
return$handle;
310310
}
@@ -329,7 +329,7 @@ sub is_data_identic()
329329
$self->{nodes}->[$i]->psql('postgres',$sql,stdout=> \$current_hash);
330330
if ($current_hasheq'')
331331
{
332-
diag("got empty hash from node$i");
332+
note("got empty hash from node$i");
333333
return 0;
334334
}
335335
if ($checksumeq'')
@@ -338,12 +338,12 @@ sub is_data_identic()
338338
}
339339
elsif ($checksumne$current_hash)
340340
{
341-
diag("got different hashes:$checksum ang$current_hash");
341+
note("got different hashes:$checksum ang$current_hash");
342342
return 0;
343343
}
344344
}
345345

346-
diag($checksum);
346+
note($checksum);
347347
return 1;
348348
}
349349

‎t/000_truncate.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$cluster->init();
1414
$cluster->configure();
1515
$cluster->start();
16-
diag("sleeping 10");
16+
note("sleeping 10");
1717
sleep(10);
1818

1919
my ($in,$out,$err,$rc);
@@ -28,7 +28,7 @@
2828
-p=>$cluster->{nodes}->[0]->port(),
2929
'postgres',
3030
);
31-
diag("running pgbench init");
31+
note("running pgbench init");
3232
my$init_run = start(\@init_argv,$in,$out);
3333
finish($init_run) || BAIL_OUT("pgbench exited with$?");
3434

@@ -41,7 +41,7 @@
4141
-p=>$cluster->{nodes}->[0]->port(),
4242
'postgres',
4343
);
44-
diag("running pgbench:" .join('',@bench_argv));
44+
note("running pgbench:" .join('',@bench_argv));
4545
my$bench_run = start(\@bench_argv,$in,$out);
4646
sleep(2);
4747

‎t/001_basic_recovery.pl

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# Work after node stop
4040
###############################################################################
4141

42-
diag("stopping node 2");
42+
note("stopping node 2");
4343
if ($cluster->stopid(2,'fast')) {
4444
pass("node 2 stops in fast mode");
4545
}else {
@@ -49,68 +49,69 @@
4949

5050
sleep(5);# Wait until failure of node will be detected
5151

52-
diag("inserting 2 on node 0");
52+
note("inserting 2 on node 0");
5353
$ret =$cluster->psql(0,'postgres',"insert into t values(2, 20);");# this transaciton may fail
54-
diag"tx1 status =$ret";
54+
note"tx1 status =$ret";
55+
5556

56-
diag("inserting 3 on node 1");
57+
note("inserting 3 on node 1");
5758
$ret =$cluster->psql(1,'postgres',"insert into t values(3, 30);");# this transaciton may fail
58-
diag"tx2 status =$ret";
59+
note("tx2 status =$ret");
5960

60-
diag("inserting 4 on node 0 (can fail)");
61+
note("inserting 4 on node 0 (can fail)");
6162
$ret =$cluster->psql(0,'postgres',"insert into t values(4, 40);");
62-
diag"tx1 status =$ret";
63+
note"tx1 status =$ret";
6364

64-
diag("inserting 5 on node 1 (can fail)");
65+
note("inserting 5 on node 1 (can fail)");
6566
$ret =$cluster->psql(1,'postgres',"insert into t values(5, 50);");
66-
diag"tx2 status =$ret";
67+
note("tx2 status =$ret");
6768

68-
diag("selecting");
69+
note("selecting");
6970
$cluster->psql(1,'postgres',"select v from t where k=4;",stdout=> \$psql_out);
70-
diag("selected");
71+
note("selected");
7172
is($psql_out,'40',"Check replication after node failure.");
7273

7374
###############################################################################
7475
# Work after node start
7576
###############################################################################
7677

77-
diag("starting node 2");
78+
note("starting node 2");
7879
$cluster->{nodes}->[2]->start;
7980

8081
sleep(5);# Wait until node is started
8182

82-
diag("inserting 6 on node 0 (can fail)");
83+
note("inserting 6 on node 0 (can fail)");
8384
$cluster->psql(0,'postgres',"insert into t values(6, 60);");
84-
diag("inserting 7 on node 1 (can fail)");
85+
note("inserting 7 on node 1 (can fail)");
8586
$cluster->psql(1,'postgres',"insert into t values(7, 70);");
8687

87-
diag("polling node 2");
88+
note("polling node 2");
8889
for (my$poller = 0;$poller < 3;$poller++) {
8990
my$pollee = 2;
9091
ok($cluster->poll($poller,'postgres',$pollee, 10, 1),"node$pollee is online according to node$poller");
9192
}
9293

93-
diag("getting cluster state");
94+
note("getting cluster state");
9495
$cluster->psql(0,'postgres',"select * from mtm.get_cluster_state();",stdout=> \$psql_out);
95-
diag("Node 1 status:$psql_out");
96+
note("Node 1 status:$psql_out");
9697
$cluster->psql(1,'postgres',"select * from mtm.get_cluster_state();",stdout=> \$psql_out);
97-
diag("Node 2 status:$psql_out");
98+
note("Node 2 status:$psql_out");
9899
$cluster->psql(2,'postgres',"select * from mtm.get_cluster_state();",stdout=> \$psql_out);
99-
diag("Node 3 status:$psql_out");
100+
note("Node 3 status:$psql_out");
100101

101-
diag("inserting 8 on node 0");
102+
note("inserting 8 on node 0");
102103
$cluster->psql(0,'postgres',"insert into t values(8, 80);");
103-
diag("inserting 9 on node 1");
104+
note("inserting 9 on node 1");
104105
$cluster->psql(1,'postgres',"insert into t values(9, 90);");
105106

106-
diag("selecting from node 2");
107+
note("selecting from node 2");
107108
$cluster->psql(2,'postgres',"select v from t where k=8;",stdout=> \$psql_out);
108-
diag("selected");
109+
note("selected");
109110

110111
is($psql_out,'80',"Check replication after failed node recovery.");
111112

112113
$cluster->psql(2,'postgres',"select v from t where k=9;",stdout=> \$psql_out);
113-
diag("selected");
114+
note("selected");
114115

115116
is($psql_out,'90',"Check replication after failed node recovery.");
116117

‎t/002_cross.pl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
my ($rc,$in,$out,$err);
2020

21-
diag("sleeping 10");
21+
note("sleeping 10");
2222
sleep(10);
2323

24-
diag("preparing the tables");
24+
note("preparing the tables");
2525
if ($cluster->psql(0,'postgres',"create table t (k int primary key, v int)"))
2626
{
2727
$cluster->bail_out_with_logs('failed to create t');
@@ -50,7 +50,7 @@ sub appender
5050
'postgres',
5151
);
5252

53-
diag("running[" . getcwd() ."]:" .join('',@argv));
53+
note("running[" . getcwd() ."]:" .join('',@argv));
5454

5555
return start(\@argv,$inref,$outref);
5656
}
@@ -59,12 +59,12 @@ sub state_dump
5959
{
6060
my$state =shift;
6161

62-
diag("<<<<<");
62+
note("<<<<<");
6363
while (my ($key,$value) =each(%{$state}))
6464
{
65-
diag("$key ->$value");
65+
note("$key ->$value");
6666
}
67-
diag(">>>>>");
67+
note(">>>>>");
6868
}
6969

7070
substate_leq
@@ -75,13 +75,13 @@ sub state_leq
7575
{
7676
if (!exists($b->{$key}))
7777
{
78-
diag("b has no key$key\n");
78+
note("b has no key$key\n");
7979
return 0;
8080
}
8181

8282
if ($b->{$key} <$value)
8383
{
84-
diag($b->{$key} ." <$value\n");
84+
note($b->{$key} ." <$value\n");
8585
return 0;
8686
}
8787
}
@@ -102,8 +102,8 @@ sub parse_state
102102
return$state;
103103
}
104104

105-
diag("starting appenders");
106-
diag("starting benches");
105+
note("starting appenders");
106+
note("starting benches");
107107
$in ='';
108108
$out ='';
109109
my@appenders = ();
@@ -136,13 +136,13 @@ sub parse_state
136136
{
137137
if (!state_leq($state_a,$state_b) && !state_leq($state_a,$state_b))
138138
{
139-
diag("cross anomaly detected:\n===a\n$out_a\n+++b\n$out_b\n---\n");
139+
note("cross anomaly detected:\n===a\n$out_a\n+++b\n$out_b\n---\n");
140140
$anomalies++;
141141
}
142142
}
143143
}
144144

145-
diag("finishing benches");
145+
note("finishing benches");
146146
foreachmy$appender (@appenders)
147147
{
148148
if (!finish($appender))

‎t/003_pgbench.pl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
my ($rc,$in,$out,$err);
1818

19-
diag("sleeping 10");
19+
note("sleeping 10");
2020
sleep(10);
2121

22-
diag("preparing the tables");
22+
note("preparing the tables");
2323
if ($cluster->psql(0,'postgres',"create table t (k int primary key, v int)"))
2424
{
2525
$cluster->bail_out_with_logs('failed to create t');
@@ -56,7 +56,7 @@ sub reader
5656
'postgres',
5757
);
5858

59-
diag("running[" . getcwd() ."]:" .join('',@argv));
59+
note("running[" . getcwd() ."]:" .join('',@argv));
6060

6161
return start(\@argv,$inref,$outref);
6262
}
@@ -80,12 +80,12 @@ sub writer
8080
'postgres',
8181
);
8282

83-
diag("running[" . getcwd() ."]:" .join('',@argv));
83+
note("running[" . getcwd() ."]:" .join('',@argv));
8484

8585
return start(\@argv,$inref,$outref);
8686
}
8787

88-
diag("starting benches");
88+
note("starting benches");
8989
$in ='';
9090
$out ='';
9191
my@benches = ();
@@ -95,14 +95,14 @@ sub writer
9595
push(@benches, reader($node, \$in, \$out));
9696
}
9797

98-
diag("finishing benches");
98+
note("finishing benches");
9999
foreachmy$bench (@benches)
100100
{
101101
finish($bench) ||$cluster->bail_out_with_logs("pgbench exited with$?");
102102
}
103-
diag($out);
103+
note($out);
104104

105-
diag("checking readers' logs");
105+
note("checking readers' logs");
106106

107107
($rc,$out,$err) =$cluster->psql(0,'postgres',"select count(*) from reader_log where v != 0;");
108108
is($out, 0,"there is nothing except zeros in reader_log");

‎t/004_recovery.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
$cluster->psql(1,'postgres',$hash_query,stdout=> \$hash1);
4949
$cluster->psql(2,'postgres',$hash_query,stdout=> \$hash2);
5050

51-
diag("$oldhash,$hash0,$hash1,$hash2");
51+
note("$oldhash,$hash0,$hash1,$hash2");
5252
is( (($hash0 ==$hash1)and ($hash1 ==$hash2)and ($oldhash ==$hash0)) , 1,"Check that hash is the same after recovery");
5353

5454
########################################################
@@ -108,14 +108,14 @@
108108
$cluster->psql(0,'postgres',$hash_query,stdout=> \$hash0);
109109
$cluster->psql(1,'postgres',$hash_query,stdout=> \$hash1);
110110
$cluster->psql(2,'postgres',$hash_query,stdout=> \$hash2);
111-
diag("$hash0,$hash1,$hash2");
111+
note("$hash0,$hash1,$hash2");
112112
is( (($hash0 ==$hash1)and ($hash1 ==$hash2)) , 1,"Check that hash is the same");
113113

114114
# $cluster->psql(0, 'postgres', "select sum(abalance) from pgbench_accounts;", stdout => \$sum0);
115115
# $cluster->psql(1, 'postgres', "select sum(abalance) from pgbench_accounts;", stdout => \$sum1);
116116
# $cluster->psql(2, 'postgres', "select sum(abalance) from pgbench_accounts;", stdout => \$sum2);
117117

118-
#diag("Sums: $sum0, $sum1, $sum2");
118+
#note("Sums: $sum0, $sum1, $sum2");
119119
# is($sum2, $sum0, "Check that sum_2 == sum_0");
120120
# is($sum2, $sum1, "Check that sum_2 == sum_1");
121121

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp