diff --git a/src/php/tests/interop/xds_client.php b/src/php/tests/interop/xds_client.php index 3990c2198cd..b814652063d 100644 --- a/src/php/tests/interop/xds_client.php +++ b/src/php/tests/interop/xds_client.php @@ -386,10 +386,14 @@ class ClientThread extends Thread { // $this->metadata_to_send[$rpc] somehow becomes a // Volatile object, instead of an associative array. $metadata_array = []; + $execute_in_child_process = false; foreach ($metadata as $key => $value) { $metadata_array[$key] = [$value]; + if ($key == 'rpc-behavior' || $key == 'fi_testcase') { + $execute_in_child_process = true; + } } - if ($metadata_array && $this->rpc_config->tmp_file1) { + if ($execute_in_child_process && $this->rpc_config->tmp_file1) { // if 'rpc-behavior' is set, we need to pawn off // the execution to some other child PHP processes $this->execute_rpc_in_child_process( diff --git a/src/ruby/pb/test/xds_client.rb b/src/ruby/pb/test/xds_client.rb index 2eab7b56598..ed111b0d106 100755 --- a/src/ruby/pb/test/xds_client.rb +++ b/src/ruby/pb/test/xds_client.rb @@ -283,7 +283,7 @@ def run_test_loop(stub, target_seconds_between_rpcs, fail_on_failed_rpcs) raise "Unsupported rpc #{rpc}" end rpc_stats_key = rpc.to_s - if not metadata.empty? + if metadata.key?('rpc-behavior') or metadata.key?('fi_testcase') keep_open_threads << execute_rpc_in_thread(op, rpc_stats_key) else results[rpc] = execute_rpc(op, fail_on_failed_rpcs, rpc_stats_key)