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

Commitef73a81

Browse files
committed
Enforce our convention about max number of parallel regression tests.
We have a very old rule that parallel_schedule should have no morethan twenty tests in any one parallel group, so as to provide abound on the number of concurrently running processes needed topass the tests. But people keep forgetting the rule, so let's adda few lines of code to check it.Discussion:https://postgr.es/m/a37e9c57-22d4-1b82-1270-4501cd2e984e@2ndquadrant.com
1 parent1fdab4d commitef73a81

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

‎src/test/regress/GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ tablespace-setup:
124124
## Run tests
125125
##
126126

127-
REGRESS_OPTS = --dlpath=.$(EXTRA_REGRESS_OPTS)
127+
REGRESS_OPTS = --dlpath=.--max-concurrent-tests=20$(EXTRA_REGRESS_OPTS)
128128

129129
check: all tablespace-setup
130130
$(pg_regress_check)$(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule$(MAXCONNOPT)$(EXTRA_TESTS)

‎src/test/regress/pg_regress.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ char *launcher = NULL;
7878
static_stringlist*loadlanguage=NULL;
7979
static_stringlist*loadextension=NULL;
8080
staticintmax_connections=0;
81+
staticintmax_concurrent_tests=0;
8182
staticchar*encoding=NULL;
8283
static_stringlist*schedulelist=NULL;
8384
static_stringlist*extra_tests=NULL;
@@ -1592,9 +1593,9 @@ run_schedule(const char *schedule, test_function tfunc)
15921593
FILE*scf;
15931594
intline_num=0;
15941595

1595-
memset(resultfiles,0,sizeof(_stringlist*)*MAX_PARALLEL_TESTS);
1596-
memset(expectfiles,0,sizeof(_stringlist*)*MAX_PARALLEL_TESTS);
1597-
memset(tags,0,sizeof(_stringlist*)*MAX_PARALLEL_TESTS);
1596+
memset(resultfiles,0,sizeof(resultfiles));
1597+
memset(expectfiles,0,sizeof(expectfiles));
1598+
memset(tags,0,sizeof(tags));
15981599

15991600
scf=fopen(schedule,"r");
16001601
if (!scf)
@@ -1614,6 +1615,7 @@ run_schedule(const char *schedule, test_function tfunc)
16141615

16151616
line_num++;
16161617

1618+
/* clear out string lists left over from previous line */
16171619
for (i=0;i<MAX_PARALLEL_TESTS;i++)
16181620
{
16191621
if (resultfiles[i]==NULL)
@@ -1667,8 +1669,8 @@ run_schedule(const char *schedule, test_function tfunc)
16671669
if (num_tests >=MAX_PARALLEL_TESTS)
16681670
{
16691671
/* can't print scbuf here, it's already been trashed */
1670-
fprintf(stderr,_("too many parallel tests in schedule file \"%s\", line %d\n"),
1671-
schedule,line_num);
1672+
fprintf(stderr,_("too many parallel tests(more than %d)in schedule file \"%s\" line %d\n"),
1673+
MAX_PARALLEL_TESTS,schedule,line_num);
16721674
exit(2);
16731675
}
16741676
tests[num_tests]=c;
@@ -1691,6 +1693,13 @@ run_schedule(const char *schedule, test_function tfunc)
16911693
wait_for_tests(pids,statuses,NULL,1);
16921694
/* status line is finished below */
16931695
}
1696+
elseif (max_concurrent_tests>0&&max_concurrent_tests<num_tests)
1697+
{
1698+
/* can't print scbuf here, it's already been trashed */
1699+
fprintf(stderr,_("too many parallel tests (more than %d) in schedule file \"%s\" line %d\n"),
1700+
max_concurrent_tests,schedule,line_num);
1701+
exit(2);
1702+
}
16941703
elseif (max_connections>0&&max_connections<num_tests)
16951704
{
16961705
intoldest=0;
@@ -1999,6 +2008,8 @@ help(void)
19992008
printf(_(" tests; can appear multiple times\n"));
20002009
printf(_(" --max-connections=N maximum number of concurrent connections\n"));
20012010
printf(_(" (default is 0, meaning unlimited)\n"));
2011+
printf(_(" --max-concurrent-tests=N maximum number of concurrent tests in schedule\n"));
2012+
printf(_(" (default is 0, meaning unlimited)\n"));
20022013
printf(_(" --outputdir=DIR place output files in DIR (default \".\")\n"));
20032014
printf(_(" --schedule=FILE use test ordering schedule from FILE\n"));
20042015
printf(_(" (can be used multiple times to concatenate)\n"));
@@ -2048,6 +2059,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
20482059
{"launcher",required_argument,NULL,21},
20492060
{"load-extension",required_argument,NULL,22},
20502061
{"config-auth",required_argument,NULL,24},
2062+
{"max-concurrent-tests",required_argument,NULL,25},
20512063
{NULL,0,NULL,0}
20522064
};
20532065

@@ -2161,6 +2173,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
21612173
case24:
21622174
config_auth_datadir=pg_strdup(optarg);
21632175
break;
2176+
case25:
2177+
max_concurrent_tests=atoi(optarg);
2178+
break;
21642179
default:
21652180
/* getopt_long already emitted a complaint */
21662181
fprintf(stderr,_("\nTry \"%s -h\" for more information.\n"),

‎src/tools/msvc/vcregress.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ sub installcheck
104104
"--dlpath=.",
105105
"--bindir=../../../$Config/psql",
106106
"--schedule=${schedule}_schedule",
107+
"--max-concurrent-tests=20",
107108
"--encoding=SQL_ASCII",
108109
"--no-locale");
109110
push(@args,$maxconn)if$maxconn;
@@ -122,6 +123,7 @@ sub check
122123
"--dlpath=.",
123124
"--bindir=",
124125
"--schedule=${schedule}_schedule",
126+
"--max-concurrent-tests=20",
125127
"--encoding=SQL_ASCII",
126128
"--no-locale",
127129
"--temp-instance=./tmp_check");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp