aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration/build_event_stream_test.sh
diff options
context:
space:
mode:
authorGravatar aehlig <aehlig@google.com>2017-05-08 10:02:17 -0400
committerGravatar Kristina Chodorow <kchodorow@google.com>2017-05-09 10:50:17 -0400
commitc964ad8393137bfc89505ac90dfa49b751eee9a9 (patch)
tree02ed3ee1aa1d340f75479470bcd1fe2e3e86bce3 /src/test/shell/integration/build_event_stream_test.sh
parent9ab58211439d183fed38d3f8649c35c69591540c (diff)
Automated g4 rollback of commit 48c636637a5a4fba1c0c509bdc3724450155d792.
*** Reason for rollback *** Rollforward with fix To have stdout/stderr in the BuildEventStream, the BuildEventStreamerModule registers a listener that accumulates the values for the streamer to collect it and regularly send it over the stream. As we have to also catch stdout/stderr that happens early in the build, we have to register the listener before(!) the options are parsed; therefore it is registered unconditionally. Now, if there is no streamer created after parsing the options there is no one to collect the data and it grows indefinitely. Fix this, by disabling the collection in this case. *** Original change description *** Automated g4 rollback of commit 9e37b2e52d6e42eec15712942c7f208b64c651e5. *** Reason for rollback *** Results in NegativeArraySizeExceptions when there's a high volume of data. *** Original change description *** BEP: Report stdout/stderr By recording registering a properly synchronized OutErr as listener and providing it as OutErrProvider to the BuildEventStreamer. Change-Id: Id553fcdb85327be28561634268511304fcc2ad3f PiperOrigin-RevId: 155374710
Diffstat (limited to 'src/test/shell/integration/build_event_stream_test.sh')
-rwxr-xr-xsrc/test/shell/integration/build_event_stream_test.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 32c128612f..f6cd382b84 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -384,4 +384,20 @@ function test_loading_failure_keep_going() {
# expect_not_log 'aborted'
# }
+function test_stdout_stderr_reported() {
+ # Verify that bazel's stdout/stderr is included in the build event stream.
+
+ # Make sure we generate enough output on stderr
+ bazel clean --expunge
+ bazel test --experimental_build_event_text_file=$TEST_log --curses=no \
+ pkg:slow 2>stderr.log || fail "slowtest failed"
+ # Take a line that is likely not the output of an action (possibly reported
+ # independently in the stream) and still characteristic enough to not occur
+ # in the stream by accident. Taking the first line mentioning the test name
+ # is likely some form of progress report.
+ sample_line=`cat stderr.log | grep 'slow' | head -1 | tr '[]' '..'`
+ echo "Sample regexp of stderr: ${sample_line}"
+ expect_log "stderr.*$sample_line"
+}
+
run_suite "Integration tests for the build event stream"