Skip to content

Commit ab35469

Browse files
Benabikgitster
authored andcommitted
t9501: Re-fix max load test
Revert the previous attempt to skip this test on platforms where we currently cannot determine the system load. We want to make sure that the max-load-limit codepath produces results cleanly, when gitweb is updated and becomes capable of reading the load average by some other method. The code to check for load returns 0 if it doesn't know how to find load. It also checks to see if the current load is higher than the max load. So to force the script to quit early by setting the maxload variable negative which should work for systems where we can detect load (which should be a positive number) and systems where we can't (where detected load is 0) Signed-off-by: Brian Gernhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6d0d465 commit ab35469

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

t/t9501-gitweb-standalone-http-status.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,12 @@ test_debug 'cat gitweb.output'
115115
# ----------------------------------------------------------------------
116116
# load checking
117117

118-
if test -e /proc/loadavg
119-
then
120-
test_set_prereq PROC_LOADAVG
121-
else
122-
say 'skipping load tests (no /proc/loadavg found)'
123-
fi
124-
125118
# always hit the load limit
126119
cat >>gitweb_config.perl <<\EOF
127-
our $maxload = 0;
120+
our $maxload = -1;
128121
EOF
129122

130-
test_expect_success PROC_LOADAVG 'load checking: load too high (default action)' '
123+
test_expect_success 'load checking: load too high (default action)' '
131124
gitweb_run "p=.git" &&
132125
grep "Status: 503 Service Unavailable" gitweb.headers &&
133126
grep "503 - The load average on the server is too high" gitweb.body

0 commit comments

Comments
 (0)