Repository navigation
test(integration): add --rcu mode to improved_run_e2e_tests.sh - #5288
PranjalC100 wants to merge 1 commit into
Conversation
RCU (Rapid Cache Ultra) caches can't be created per test run, so --rcu runs the e2e packages on a pre-created pool of HNS RCU buckets <prefix>-1..N instead of creating a bucket per package. - --rcu-bucket-prefix picks the pool. It defaults to gcsfuse-e2e-rcu-<VM zone>-bucket. - Before the run, each pool bucket must have a running rapid-cache-ultra cache in the VM zone. With --rcu-different-zone (forwarded to the tests), the caches must be outside the VM zone instead. Without this check, a bucket that lost its cache runs silently as plain HNS. - A label on <prefix>-1, set with an ifMetagenerationMatch PATCH, locks the pool against concurrent runs. A lock older than 12h is stale. - Each package leases a bucket. The bucket is emptied (objects, managed folders, leftover HNS folders) before reuse, and dropped from the pool if that fails. - Parallelism is capped at 10, the pool size. --rcu is mutually exclusive with --zonal and --test-on-tpc-endpoint.
There was a problem hiding this comment.
Code Review
This pull request adds support for running end-to-end integration tests against pre-created Rapid Cache Ultra (RCU) buckets. It introduces command-line options (--rcu, --rcu-bucket-prefix, and --rcu-different-zone), implements a cross-run locking mechanism using bucket labels to prevent concurrent runs from interfering with shared buckets, and adds logic to safely empty and validate RCU buckets during parallel test execution. The review feedback points out that the check for empty buckets when running gcloud storage rm might fail because the output message can vary (e.g., "No URLs matched" instead of "matched no objects"), and suggests using an explicit if/else structure to handle this case robustly.
| # 'gs://bucket/**' targets only the contents; 'gs://bucket' with --recursive would delete the bucket too. | ||
| if ! output=$(gcloud storage rm --recursive "gs://${bucket}/**" --project="${PROJECT_ID}" --quiet 2>&1); then | ||
| # An already-empty bucket is not an error. | ||
| if [[ "$output" != *"matched no objects"* ]]; then |
There was a problem hiding this comment.
The error message returned by gcloud storage rm when no objects match the wildcard is typically No URLs matched (or Did not match any URLs in older gsutil versions), rather than matched no objects. If the bucket is already empty, this check will fail to recognize it as a non-error. Please update the condition to check for both cases. Additionally, please use an explicit if/else structure instead of the && chain to improve readability and adhere to repository standards for shell scripts.
| if [[ "$output" != *"matched no objects"* ]]; then | |
| if [[ "$output" == *"matched no objects"* ]] || [[ "$output" == *"No URLs matched"* ]]; then | |
| # Handle success case | |
| : | |
| else | |
| # Handle error case | |
| exit 1 | |
| fi |
References
- In shell scripts, use an explicit if/else structure for fallback logic instead of the && || chain to improve readability and avoid unexpected behavior.
Description
Adds
--rcutotools/integration_tests/improved_run_e2e_tests.sh. RCU (Rapid Cache Ultra) caches can't be created per run, so this mode runs the e2e packages on a pre-created pool of HNS RCU buckets<prefix>-1..N.--rcu-bucket-prefix: pool prefix, defaultgcsfuse-e2e-rcu-<VM zone>-bucket.rapid-cache-ultracache in the VM zone, or outside it with--rcu-different-zone(forwarded to the tests). Without it, a bucket that lost its cache runs silently as plain HNS.<prefix>-1, set with anifMetagenerationMatchPATCH. A lock older than 12h is stale.--rcuis mutually exclusive with--zonaland--test-on-tpc-endpoint.Link to the issue in case of a bug fix.
NA
Testing details
--rcurun of an earlier version on a europe-west1-b VM passed every package exceptmanaged_folders. This version was tested in a sandbox with stubbedgcloud,curlandgo: same zone, cross zone with and without the flag, missing, not-running and wrong-type caches, a missing pool, held and stale locks, a package failure, and all 37 RCU packages at parallelism 10. A us-east7-c run on a real VM is pending.Any backward incompatible change? If so, please explain.
No. It only adds options; the other modes are unchanged.