Skip to content

Commit aeea6ea

Browse files
committed
Increase journald rate limiter when running test-end-to-end-docker.sh
1 parent fc2df8f commit aeea6ea

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

hack/lib/util/misc.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ readonly -f os::util::format_seconds
120120
# Return:
121121
# None
122122
function os::util::sed() {
123+
local sudo="${USE_SUDO:+sudo}"
123124
if LANG=C sed --help 2>&1 | grep -q "GNU sed"; then
124-
sed -i'' "$@"
125+
${sudo} sed -i'' "$@"
125126
else
126-
sed -i '' "$@"
127+
${sudo} sed -i '' "$@"
127128
fi
128129
}
129130
readonly -f os::util::sed
@@ -203,4 +204,4 @@ function os::util::curl_etcd() {
203204
function os::util::host_platform() {
204205
echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
205206
}
206-
readonly -f os::util::host_platform
207+
readonly -f os::util::host_platform

hack/test-end-to-end-docker.sh

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ function cleanup()
5454
os::test::junit::generate_oscmd_report
5555
set -e
5656

57+
# restore journald to previous form
58+
${USE_SUDO:+sudo} mv /etc/systemd/{journald.conf.bak,journald.conf}
59+
${USE_SUDO:+sudo} systemctl restart systemd-journald.service
60+
5761
os::log::info "Exiting"
5862
ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"
5963
exit $out
@@ -63,6 +67,13 @@ trap "cleanup" EXIT INT TERM
6367

6468
os::log::system::start
6569

70+
# This increases rate limits in journald to bypass the problem from
71+
# https://github.com/openshift/origin/issues/12558.
72+
${USE_SUDO:+sudo} cp /etc/systemd/{journald.conf,journald.conf.bak}
73+
os::util::sed "s/^.*RateLimitInterval.*$/RateLimitInterval=1s/g" /etc/systemd/journald.conf
74+
os::util::sed "s/^.*RateLimitBurst.*$/RateLimitBurst=10000/g" /etc/systemd/journald.conf
75+
${USE_SUDO:+sudo} systemctl restart systemd-journald.service
76+
6677
out=$(
6778
set +e
6879
docker stop origin 2>&1

0 commit comments

Comments
 (0)