Skip to content
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

chore(bigtable): Conformance test tweaks #29400

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions google-cloud-bigtable/.toys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
tool "conformance" do
tool "test" do
flag :port, "--port=VAL", default: ENV["PORT"] || "9999"
flag :focus, "--run=REGEXP", "--focus=REGEXP"

include :git_cache
include :exec
Expand All @@ -38,14 +39,16 @@ def run
known_failures = File.read("conformance/known_failures.txt").split.join("|")
test_dir = git_cache.get "https://github.com/googleapis/cloud-bigtable-clients-test.git", update: true
result = nil
exec_tool ["conformance", "run-proxy", "--port", port], out: :controller do |controller|
exec_tool ["conformance", "run-proxy", "--port", port],
out: [:tee, :controller, :inherit], in: :null do |controller|
logger.info "Waiting for server to start..."
loop do
break if controller.out.readline.strip == "SERVER STARTED"
end
logger.info "Got server start signal. Running test suite..."
Dir.chdir "#{test_dir}/tests" do
result = exec ["go", "test", "-v", "-proxy_addr=:#{port}", "-skip=#{known_failures}"]
which_tests = focus ? "-run=#{focus}" : "-skip=#{known_failures}"
result = exec ["go", "test", "-v", "-proxy_addr=:#{port}", which_tests]
end
controller.kill "SIGINT"
end
Expand Down
3 changes: 1 addition & 2 deletions google-cloud-bigtable/conformance/known_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ TestReadRow_Generic_CloseClient
TestReadRow_Retry_WithRoutingCookie
TestReadRow_Retry_WithRetryInfo
TestReadRows_NoRetry_OutOfOrderError
TestReadRows_NoRetry_OutOfOrderError_Reverse
TestReadRows_ReverseScans_FeatureFlag_Enabled
TestReadRows_Retry_PausedScan
TestReadRows_Retry_LastScannedRow
TestReadRows_Retry_LastScannedRow_Reverse
TestReadRows_Retry_StreamReset
TestReadRows_Generic_CloseClient
TestReadRows_Generic_DeadlineExceeded
TestReadRows_Retry_WithRoutingCookie
Expand Down
20 changes: 7 additions & 13 deletions google-cloud-bigtable/conformance/test_proxy/test_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def table name
@bigtable.table instance_id, name.split("/").last, app_profile_id: app_profile_id
end

attr_reader :timeout

private

attr_accessor :instance_id
Expand All @@ -93,28 +95,19 @@ def initialize client_id:, data_target:, project_id:, instance_id:,
self.instance_id = instance_id
self.app_profile_id = app_profile_id

timeout = if per_operation_timeout
assert (per_operation_timeout.keys.sort == [:nanos, :seconds]),
"Unexpected format for per_operation_timeout (got #{per_operation_timeout})"
# At time of writing, no tests are using nanos, so we don't use that field.
# If this changes, update tests.
assert per_operation_timeout[:nanos].zero?,
"Timeout specified with nanos, update proxy to handle this"

per_operation_timeout[:seconds]
end
@timeout = per_operation_timeout[:seconds].to_i if per_operation_timeout

# At time of writing, the only value ever supplied here OPTIONAL_FEATURE_CONFIG_DEFAULT
assert optional_feature_config == :OPTIONAL_FEATURE_CONFIG_DEFAULT,
"optional_feature_config was set to an unexpected value"

@bigtable = connect project_id, timeout, data_target
@bigtable = connect project_id, data_target
end

def connect project_id, timeout, data_target
def connect project_id, data_target
args = {
project_id: project_id,
timeout: timeout
timeout: @timeout
}.compact

if data_target == "emulator"
Expand Down Expand Up @@ -469,3 +462,4 @@ def unimplemented_status message = ""
server.handle TestProxyServer
puts "SERVER STARTED"
server.run_till_terminated_or_interrupted [1, "int", "SIGTERM"]
puts "SERVER STOPPED"
Loading