azure-sdk-for-ruby icon indicating copy to clipboard operation
azure-sdk-for-ruby copied to clipboard

Configure long running operations timeout

Open digaoddc opened this issue 4 years ago • 0 comments

Hello. I spent some hours debugging one test to figure out why a request that was recorded with VCR was taking 30 seconds to run. This is strange because the request was recorded so no real request was made.

I found this line was causing this behavior https://github.com/Azure/azure-sdk-for-ruby/blob/373a9a0fae0de9bbe4d3948c99a25d6656bef14b/runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb#L81 . Basically it waits 30 seconds to parse the response. This behavior is not good in test mode.

This option long_running_operation_retry_timeout could be passed in the client parameters or in the env vars.

Something like this:

options = {
  client_id: ENV['AZURE_CLIENT_ID'],
  long_running_operation_timeout: ENV['AZURE_LONG_OPERATION_TIMEOUT']
}

profile_client = Azure::Profiles::V2017_03_09::Mgmt::Client.new(options)

Can you help me with this?

digaoddc avatar Apr 09 '20 13:04 digaoddc