-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[DRAFT] chore: improve system tests #18206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
daniel-sanche
wants to merge
3
commits into
googleapis:main
Choose a base branch
from
daniel-sanche:improve_stuck_system_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,7 @@ run_package_test() { | |
| reap_parallel_results() { | ||
| local retval=0 | ||
| local failed_count=0 | ||
| local timed_out_count=0 | ||
| local succeeded_count=0 | ||
|
|
||
| if [ -z "$LOG_DIR" ]; then | ||
|
|
@@ -142,6 +143,13 @@ reap_parallel_results() { | |
| fi | ||
| done | ||
|
|
||
| # Count timed out packages by checking for .timed_out marker files | ||
| for timed_out in "$LOG_DIR"/*.timed_out; do | ||
| if [ -f "$timed_out" ]; then | ||
| timed_out_count=$((timed_out_count + 1)) | ||
| fi | ||
| done | ||
|
|
||
| local total_tested=${#PACKAGES_TO_TEST[@]} | ||
| succeeded_count=$((total_tested - failed_count)) | ||
|
|
||
|
|
@@ -152,6 +160,9 @@ reap_parallel_results() { | |
| echo "Total Packages: $total_tested" | ||
| echo "Succeeded: $succeeded_count" | ||
| echo "Failed: $failed_count" | ||
| if [ "$timed_out_count" -gt 0 ]; then | ||
| echo "Timed Out: $timed_out_count" | ||
| fi | ||
| echo "==================================================" | ||
|
|
||
| local succeeded_packages=() | ||
|
|
@@ -168,14 +179,23 @@ reap_parallel_results() { | |
| # List failed packages | ||
| for failed in "$LOG_DIR"/*.failed; do | ||
| if [ -f "$failed" ]; then | ||
| basename "$failed" .failed | ||
| local pkg=$(basename "$failed" .failed) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if [ -f "$LOG_DIR/$pkg.timed_out" ]; then | ||
| echo "$pkg (TIMED OUT after ${PACKAGE_TEST_TIMEOUT})" | ||
| else | ||
| echo "$pkg" | ||
| fi | ||
| fi | ||
| done | ||
| for failed in "$LOG_DIR"/*.failed; do | ||
| if [ -f "$failed" ]; then | ||
| local pkg=$(basename "$failed" .failed) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| echo "--------------------------------------------------" | ||
| echo "@PACKAGE (FAILED): $pkg" | ||
| if [ -f "$LOG_DIR/$pkg.timed_out" ]; then | ||
| echo "@PACKAGE (TIMED OUT after ${PACKAGE_TEST_TIMEOUT}): $pkg" | ||
| else | ||
| echo "@PACKAGE (FAILED): $pkg" | ||
| fi | ||
| echo "--------------------------------------------------" | ||
| if [ -n "$KOKORO_ARTIFACTS_DIR" ] && [ -f "$KOKORO_ARTIFACTS_DIR/$pkg/sponge_log.log" ]; then | ||
| cat "$KOKORO_ARTIFACTS_DIR/$pkg/sponge_log.log" | ||
|
|
@@ -287,6 +307,7 @@ done | |
|
|
||
| # Parallel Execution Logic | ||
| MAX_JOBS=${MAX_JOBS:-4} | ||
| PACKAGE_TEST_TIMEOUT="${PACKAGE_TEST_TIMEOUT:-35m}" | ||
|
|
||
| # Temporary directory for clean log segregation | ||
| LOG_DIR=$(mktemp -d -t test-logs-XXXXXX) | ||
|
|
@@ -301,9 +322,10 @@ fi | |
| echo "==================================================" | ||
| echo "Starting parallel test execution for ${#PACKAGES_TO_TEST[@]} packages" | ||
| echo "Concurrency limit: ${MAX_JOBS}" | ||
| echo "Per-package timeout: ${PACKAGE_TEST_TIMEOUT}" | ||
| echo "==================================================" | ||
|
|
||
| export LOG_DIR | ||
| export LOG_DIR PACKAGE_TEST_TIMEOUT | ||
| export -f run_package_test | ||
| export system_test_script PROJECT_ROOT KOKORO_GFILE_DIR | ||
|
|
||
|
|
@@ -323,8 +345,22 @@ printf '%s\n' "${PACKAGES_TO_TEST[@]}" \ | |
| log_file="$LOG_DIR/$pkg.log" | ||
| fi | ||
|
|
||
| # Run test; if it fails, create a .failed file to signal failure to the reaper | ||
| run_package_test "$pkg" > "$log_file" 2>&1 || touch "$LOG_DIR/$pkg.failed" | ||
| # Run test with timeout guard; if it fails or times out, mark as failed | ||
| set +e | ||
| timeout --kill-after=1m "${PACKAGE_TEST_TIMEOUT}" bash -c '\''run_package_test "$0"'\'' "$pkg" > "$log_file" 2>&1 | ||
| status=$? | ||
| set -e | ||
|
|
||
| if [ $status -eq 124 ] || [ $status -eq 137 ]; then | ||
| echo "" >> "$log_file" | ||
| echo "==================================================" >> "$log_file" | ||
| echo "ERROR: Package test timed out after ${PACKAGE_TEST_TIMEOUT}!" >> "$log_file" | ||
| echo "==================================================" >> "$log_file" | ||
| touch "$LOG_DIR/$pkg.timed_out" | ||
| touch "$LOG_DIR/$pkg.failed" | ||
| elif [ $status -ne 0 ]; then | ||
| touch "$LOG_DIR/$pkg.failed" | ||
| fi | ||
| ' | ||
|
|
||
| reap_parallel_results || RETVAL=1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -713,3 +713,5 @@ | |
|
|
||
| ### New Features | ||
| - Initial Release of AutoML v1beta1 | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -889,3 +889,5 @@ | |
| 11-29-2018 13:45 PST | ||
|
|
||
| - Initial release of BigQuery Storage API client. | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -831,3 +831,5 @@ | |
|
|
||
| ### New Features | ||
| - KMS v1 | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -704,3 +704,5 @@ | |
| ## 0.0.1dev1 | ||
|
|
||
| Initial development release of NDB client library. | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,3 +81,5 @@ | |
| include_package_data=True, | ||
| zip_safe=False, | ||
| ) | ||
|
|
||
| # trigger system tests | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -734,3 +734,5 @@ | |
|
|
||
| ### New Features | ||
| - Add v2beta2 endpoint for Tasks | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -754,3 +754,5 @@ | |
| ### Interface additions | ||
|
|
||
| - Added text-to-speech v1beta1. (#5049) | ||
|
|
||
| <!-- trigger system tests --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent global namespace pollution and avoid duplicate local declarations, declare
pkgandtimed_outas local variables at the top of thereap_parallel_resultsfunction.