Skip to content

test(control-client): Adding emulator test for control client stall#4884

Open
raj-prince wants to merge 4 commits into
masterfrom
control_client_emulator_test
Open

test(control-client): Adding emulator test for control client stall#4884
raj-prince wants to merge 4 commits into
masterfrom
control_client_emulator_test

Conversation

@raj-prince

@raj-prince raj-prince commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds emulator-based integration tests to verify GCSFuse's retry-on-stall logic for Storage Control APIs (CreateFolder, GetFolder, DeleteFolder, RenameFolder, and GetStorageLayout).

Link to the issue in case of a bug fix.

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces integration tests to verify the experimental retry logic for the gRPC Control Client when encountering stalls. It adds several stall configuration files, a new test suite, and updates the emulator test runner to support HNS buckets. Additionally, other emulator tests are updated to disable HNS to avoid gRPC initialization issues with legacy proxy servers, and the gRPC proxy is updated to inject testbench instructions. The review feedback highlights two issues: a potential hazard where tearing down a failed test could attempt to kill PID 0, and a permission issue in the shell script where sudo was omitted from the docker commands.

Comment thread tools/integration_tests/emulator_tests/emulator_tests.sh Outdated
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.87%. Comparing base (508b315) to head (b31f841).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4884      +/-   ##
==========================================
+ Coverage   83.84%   83.87%   +0.03%     
==========================================
  Files         173      173              
  Lines       21083    21081       -2     
==========================================
+ Hits        17676    17681       +5     
+ Misses       2748     2743       -5     
+ Partials      659      657       -2     
Flag Coverage Δ
unittests 83.87% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raj-prince
raj-prince marked this pull request as ready for review July 15, 2026 04:48
@raj-prince
raj-prince requested review from a team and meet2mky as code owners July 15, 2026 04:48
@raj-prince
raj-prince requested a review from charith87 July 15, 2026 04:48
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jul 15, 2026
@raj-prince

Copy link
Copy Markdown
Collaborator Author

/gemini review

@raj-prince raj-prince added the execute-integration-tests Run only integration tests label Jul 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables the storage control client for localhost custom endpoints, allowing Hierarchical Namespace (HNS) features to be tested against the emulator. It introduces a new suite of integration tests to verify control client retry behavior under simulated operation stalls, updates existing emulator tests to disable HNS by default to prevent compatibility issues with legacy proxy servers, and refactors the gRPC proxy server to support bidirectional streaming and instruction injection. The reviewer identified a potential script failure in emulator_tests.sh under set -euo pipefail if grep returns no matches, and provided a robust suggestion to handle this case.

Comment on lines +207 to +210
TEST_TARGET=${TEST_TARGET:-"./tools/integration_tests/emulator_tests/..."}
# Run all emulator test packages in sequence to avoid high cpu usage.
# Run all other emulator tests with standard bucket
go test -v -p 1 -timeout 10m $(go list ${TEST_TARGET} | grep -v control_client_stall) --integrationTest --testbucket=${TEST_BUCKET:-test-bucket} "${args[@]}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Under set -euo pipefail, if TEST_TARGET is set to only run the control_client_stall tests (e.g., ./tools/integration_tests/emulator_tests/control_client_stall/...), grep -v control_client_stall will find no matches and exit with status 1. This will cause the entire script to exit immediately with an error. We should handle this gracefully by using || true and checking if the package list is non-empty before running go test.

Suggested change
TEST_TARGET=${TEST_TARGET:-"./tools/integration_tests/emulator_tests/..."}
# Run all emulator test packages in sequence to avoid high cpu usage.
# Run all other emulator tests with standard bucket
go test -v -p 1 -timeout 10m $(go list ${TEST_TARGET} | grep -v control_client_stall) --integrationTest --testbucket=${TEST_BUCKET:-test-bucket} "${args[@]}"
TEST_TARGET=${TEST_TARGET:-"./tools/integration_tests/emulator_tests/..."}
# Run all emulator test packages in sequence to avoid high cpu usage.
# Run all other emulator tests with standard bucket
TEST_PKGS=$(go list ${TEST_TARGET} | grep -v control_client_stall || true)
if [[ -n "$TEST_PKGS" ]]; then
go test -v -p 1 -timeout 10m $TEST_PKGS --integrationTest --testbucket=${TEST_BUCKET:-test-bucket} "${args[@]}"
fi

@github-actions

Copy link
Copy Markdown

Hi @meet2mky, @charith87, 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!

1 similar comment
@github-actions

Copy link
Copy Markdown

Hi @meet2mky, @charith87, 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execute-integration-tests Run only integration tests remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant