Is there a way to initialize cucmber.wire timeouts from the command line?

211 views Asked by At

I have a long running scenario using cucumber-cpp, which takes approximately 5 mins to complete. When I run the scenario with default cucumber.wire file generated by the cucumber --init command the following file is generated:

host: localhost  
port: 3902

With this configuration, I get the following error once the scenario completes:

Timed out calling wire server with message 'invoke' (Timeout::Error)
./features/some-long-running-scenario.feature:13:in `Then result1.'
./features/some-long-running-scenario.feature:9:in `Then result1.'
Timed out calling wire server with message 'end_scenario' (Timeout::Error)

I found that I need to increase the timeout of the wire protocol to make the scenario pass. I updated the cucumber.wire file to have the contents as below

host: localhost  
port: 3902
timeout:
    connect: 11
    invoke: 600
    begin_scenario: 120
    end_scenario: 120

Is there a way to set and edit these timeout values from the command line?

1

There are 1 answers

0
vedrajb On

It seems like it can be set via environment variables: https://github.com/cucumber/cucumber-ruby-wire#yaml-with-erb-templating

host: localhost
port: 54321
timeout:
  connect: <%= (ENV['MY_CONNECT_TIMEOUT'] || 11).to_i %>
  invoke: 120
  begin_scenario: 120
  end_scenario: 120