Deflake jvm_flags_escaping_test
This CL changes the test behavior to grep the log for "unexpected EOF [...]".
The affected test sends a malformed JVM option with an unterminated quote pair to the java_binary wrapper, and then attempts to execute it.
It seems that somehow, bash's "syntax error" error message doesn't always get propagated all the way to the log. This seems like recent behavior and its root cause is currently unknown.
Luckily, the actual more important error message ("unexpected EOF") still appears earlier in the log, and we'll grep for that in addition.
New error message:
```
bazel-bin/test_untokenizable_jvm_flag_when_escaping_is_enabled/cannot_tokenize: line 231: unexpected EOF while looking for matching `''
```
Old error message:
```
bazel-bin/test_untokenizable_jvm_flag_when_escaping_is_enabled/cannot_tokenize: line 231: unexpected EOF while looking for matching `''
bazel-bin/test_untokenizable_jvm_flag_when_escaping_is_enabled/cannot_tokenize: line 250: syntax error: unexpected end of file
```
PiperOrigin-RevId: 786926665
Change-Id: I0c554693a096d336694e157f507eb331582baba6
diff --git a/src/test/shell/integration/jvm_flags_escaping_test.sh b/src/test/shell/integration/jvm_flags_escaping_test.sh
index 3865c2d..8035976 100755
--- a/src/test/shell/integration/jvm_flags_escaping_test.sh
+++ b/src/test/shell/integration/jvm_flags_escaping_test.sh
@@ -287,7 +287,7 @@
bazel build --verbose_failures "${pkg}:cannot_tokenize" \
2>"$TEST_log" || fail "expected success"
expect_program_cannot_run "bazel-bin/$pkg/cannot_tokenize${EXE_EXT}"
- expect_log "syntax error"
+ expect_log "\(syntax error\)\|\(unexpected EOF while looking for matching \`''\)"
fi
}