imbajin commented on code in PR #3336: URL: https://github.com/apache/hugegraph/pull/3336#discussion_r4263860004
########## hugegraph-server/hugegraph-dist/src/assembly/travis/check-java-runtime-logs.sh: ########## @@ -0,0 +1,77 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -uo pipefail + +# Inspect only logs from a positive run, never a negative-test fixture or a +# whole workspace. Libraries can print these exceptions and still return 0. +PATTERN='java\.lang\.reflect\.InaccessibleObjectException:' +PATTERN+='|java\.lang\.(IllegalAccessError|IllegalAccessException):.*module .*does not' +PATTERN+='|Unrecognized VM option|Unrecognized option:' +PATTERN+='|Ignoring option .*support was removed|VM option .*is (not supported|obsolete|removed)' +PATTERN+='|Unable to inspect cluster runtime logs:' +if [[ "${1:-}" == --native ]]; then + # Keep native-linkage checks out of suites with intentional missing classes. + PATTERN+='|undefined symbol|UnsatisfiedLinkError|UnsupportedClassVersionError|NoClassDefFoundError' + shift +fi +if [[ $# -eq 0 ]]; then + echo "USAGE: $0 [--native] LOG_FILE_OR_DIRECTORY..." >&2 + exit 2 +fi + +STATUS=0 +check_file() { + local file="$1" matches code + if [[ ! -f "$file" || ! -r "$file" ]]; then + echo "Cannot read runtime log: $file" >&2 + STATUS=2 + return + fi + matches=$(LC_ALL=C grep -EinI -- "$PATTERN" "$file" 2>&1) Review Comment: Updated the checker to scan NUL-containing text logs instead of skipping them as binary. The regression rejects compatibility errors with and without NUL, and accepts a benign NUL log, for both file and directory inputs. Targeted checks and Java 17 compilation pass; product CI is tracked separately. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
