Skip to content

Commit 93ad9fc

Browse files
authored
Make fuzzing less verbose to avoid exceeding Travis log limit (#2126)
Fuzzing triggers many assertion failures, which generates enormous log output. AFAIK, there is no way to make `NSAssertionHandler` _not_ write to log, and the assertions themselves are valid. Thus, implement a workaround: only output the last part of the logs in Travis, in order to avoid exceeding the log size limit (4 Mb).
1 parent 36b79e6 commit 93ad9fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/fuzzing_ci.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ readonly EXIT_FAILURE=1
3636
# Get day of the year to use it when selecting a main target.
3737
readonly DOY="$(date +%j)"
3838

39+
# How many last lines of the log to output for a failing job. This is to avoid
40+
# exceeding Travis log size limit (4 Mb).
41+
readonly LINES_TO_OUTPUT=500
42+
3943
# Run fuzz testing only if executing on xcode >= 9 because fuzzing requires
4044
# Clang that supports -fsanitize-coverage=trace-pc-guard.
4145
xcode_version="$(xcodebuild -version | head -n 1)"
@@ -110,7 +114,8 @@ for i in "${!all_fuzzing_targets[@]}"; do
110114
echo "Error: Fuzz testing for target ${fuzzing_target} failed."
111115
script_return=${EXIT_FAILURE}
112116
echo "Fuzzing logs:"
113-
echo "${fuzzing_results}"
117+
echo "${fuzzing_results}" | tail -n${LINES_TO_OUTPUT}
118+
echo "End fuzzing logs"
114119
fi
115120
done
116121

0 commit comments

Comments
 (0)