Skip to content

Commit 6448e0c

Browse files
Benabikgitster
authored andcommitted
t9501: Skip testing load if we can't detect it
Currently gitweb only knows how to check for load using /proc/loadavg, which isn't available on all systems. We shouldn't fail the test just because we don't know how to check the system load. Signed-off-by: Brian Gernhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71f1a21 commit 6448e0c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,19 @@ 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+
118125
# always hit the load limit
119126
cat >>gitweb_config.perl <<\EOF
120127
our $maxload = 0;
121128
EOF
122129

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

0 commit comments

Comments
 (0)