ci: Add emulator tests (and related changes) for stalled API calls to control-client#4566
ci: Add emulator tests (and related changes) for stalled API calls to control-client#4566gargnitingoogle wants to merge 11 commits intomasterfrom
Conversation
6c26d78 to
e4ea18d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4566 +/- ##
===========================================
+ Coverage 0 83.67% +83.67%
===========================================
Files 0 164 +164
Lines 0 20213 +20213
===========================================
+ Hits 0 16913 +16913
- Misses 0 2663 +2663
- Partials 0 637 +637
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e4ea18d to
99d5068
Compare
- Added integration test suite to verify experimental stall retry logic for CreateFolder, GetFolder, DeleteFolder, RenameFolder, and GetStorageLayout. - Refactored test setup to utilize individual suite structures per API method, enabling isolated proxy config dynamic loading. - Validated that operations successfully complete within the 31s client timeout. - Validated that GetStorageLayout correctly completes the mount under 40s despite an artificial 60s stall limit specifically targeting its initial call. - Excluded ListFolders as GCSFuse internally relies on ListObjects instead of ListFolders for folder iteration. - Cleaned up unused multi-method proxy configurations. - Cleaned up setup_test.go by moving global mounting state into the test suite struct to guarantee test isolation. - Updated to use non-deprecated metadata cache TTL flags.
3b9b247 to
77076f7
Compare
| // Disable HNS to prevent gRPC Control Client initialization. | ||
| // Legacy emulator proxy servers run on HTTP/1.1, which causes the | ||
| // gRPC HTTP/2 dialer to crash the mount sequence. | ||
| "--enable-hns=false", |
There was a problem hiding this comment.
This is to keep the test same as before.
| // Disable HNS to prevent gRPC Control Client initialization. | ||
| // Legacy emulator proxy servers run on HTTP/1.1, which causes the | ||
| // gRPC HTTP/2 dialer to crash the mount sequence. | ||
| "--enable-hns=false", |
There was a problem hiding this comment.
This is to keep the test same as before.
| // Disable HNS to prevent gRPC Control Client initialization. | ||
| // Legacy emulator proxy servers run on HTTP/1.1, which causes the | ||
| // gRPC HTTP/2 dialer to crash the mount sequence. | ||
| "--enable-hns=false", |
There was a problem hiding this comment.
This is to keep the test same as before.
| flagSets := [][]string{ | ||
| {}, | ||
| {"--chunk-transfer-timeout-secs=5"}, | ||
| {"--enable-hns=false"}, |
There was a problem hiding this comment.
This is to keep the test same as before.
| if err := validateGRPCMetadata(md, validations); err != nil { | ||
| log.Printf("Metadata validation failed: %v", err) | ||
| return err | ||
| // Only validate headers for the main Storage API, not Control API |
There was a problem hiding this comment.
This change is to enable grpc proxy_server to support metadata instructions such as stall.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces robust testing capabilities for the control-client by implementing emulator tests that simulate stalled API calls. These changes ensure that the experimental retry logic for folder operations and storage layout retrieval functions correctly under adverse network conditions. Additionally, the infrastructure for the gRPC proxy server was enhanced to support instruction injection, and existing tests were updated to maintain stability during the transition to these new testing patterns. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enables the creation of the storage control client when using a custom endpoint on localhost, which was previously restricted. It introduces a comprehensive suite of integration tests to verify the experimental retry logic for stalled gRPC control client operations (CreateFolder, GetFolder, DeleteFolder, RenameFolder, and GetStorageLayout) using a proxy server to induce delays. Additionally, the gRPC proxy server is updated to support instruction injection for the testbench, and existing emulator tests are updated to explicitly disable HNS where the legacy proxy server's HTTP/1.1 limitation would cause issues. I have no feedback to provide.
There was a problem hiding this comment.
Code Review
This pull request introduces integration tests for the GCSFuse control client, specifically focusing on handling stalled gRPC responses for folder operations and storage layout queries. It includes new test configurations, a test suite in control_client_stall_test.go, and updates to the emulator test script to support HNS buckets. Additionally, the gRPC proxy was updated to inject emulator instructions for the control API. Feedback includes identifying unused variables: forcedStallTime in the test base struct and TEST_TARGET in the shell script, both of which are defined but never utilized in the execution logic.
| - method: CreateFolder | ||
| retryInstruction: "stall-for-40s" | ||
| retryCount: 1 | ||
| skipCount: 2 |
There was a problem hiding this comment.
Why is skipCcount 2here and not everywhere?
|
|
||
| assert.NoError(c.T(), err) | ||
| // Ensure the CreateFolder operation took less than 32 seconds (30 seconds first stalled-call timeout + 2 second wiggle-room) because of the internal abortion and retry. | ||
| assert.True(c.T(), elapsedTime < 32*time.Second, "Elapsed time %v should be less than 32s", elapsedTime) |
There was a problem hiding this comment.
Can we create a const for 32s, we can tell why? Also would be good to link the hardcoded initial stall timeout (30s).
|
Hi @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
3 similar comments
|
Hi @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
|
Hi @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
|
Hi @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
Description
gcr.io/cloud-devrel-public-resources/storage-testbench.Link to the issue in case of a bug fix.
b/493734599
Testing details
gcsfuse/tools/integration_tests/emulator_tests/emulator_tests.sh
Line 102 in 66fbbda
Any backward incompatible change? If so, please explain.