Skip to content

Commit

Permalink
Fix some cucumber timeout issues on MacOS in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Jun 19, 2021
1 parent a4f4691 commit d4d76b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: Stop commands
Feature: Run it
Scenario: Run command
Given the default aruba exit timeout is 0.2 seconds
And I wait 0.1 seconds for a command to start up
And I wait 0.2 seconds for a command to start up
When I run `aruba-test-cli1` in background
And I run `aruba-test-cli2` in background
And I terminate the command started last
Expand Down Expand Up @@ -98,7 +98,7 @@ Feature: Stop commands
Scenario: Run command
Given the default aruba exit timeout is 0.2 seconds
And I wait 0.1 seconds for a command to start up
And I wait 0.2 seconds for a command to start up
When I run `aruba-test-cli1` in background
And I run `aruba-test-cli2` in background
And I stop the command started last
Expand Down Expand Up @@ -148,7 +148,7 @@ Feature: Stop commands
Given the default aruba exit timeout is 0.2 seconds
Scenario: Run command
Given I wait 0.1 seconds for a command to start up
Given I wait 0.2 seconds for a command to start up
When I run `aruba-test-cli1` in background
When I run `aruba-test-cli2` in background
And I terminate the command "aruba-test-cli1"
Expand Down Expand Up @@ -200,7 +200,7 @@ Feature: Stop commands
Given the default aruba exit timeout is 0.2 seconds
Scenario: Run command
Given I wait 0.1 seconds for a command to start up
Given I wait 0.2 seconds for a command to start up
When I run `aruba-test-cli1` in background
And I run `aruba-test-cli2` in background
When I stop the command "aruba-test-cli1"
Expand Down Expand Up @@ -272,7 +272,7 @@ Feature: Stop commands
Feature: Run it
Scenario: Run command
Given the default aruba exit timeout is 0.3 seconds
And I wait 0.1 seconds for a command to start up
And I wait 0.2 seconds for a command to start up
When I run `aruba-test-cli1` in background
And I terminate the command started last
Then the exit status should be 100
Expand Down
18 changes: 9 additions & 9 deletions features/04_aruba_api/command/run_command.feature
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Feature: Run command

To run a command use the `#run_command` method. There are some configuration options
which are relevant here:
To run a command use the `#run_command` method. There are some configuration
options which are relevant here:

- `startup_wait_time`:

Given this option `aruba` waits n seconds after it started the command.
This is most useful when using `#run_command()` and not really makes sense for
`#run_command_and_stop()`.
This is most useful when using `#run_command()` and does not really make
sense for `#run_command_and_stop()`.

You can use `#run_command()` + `startup_wait_time` to start background jobs.

Expand Down Expand Up @@ -116,7 +116,7 @@ Feature: Run command
"""ruby
require 'spec_helper'
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.1, startup_wait_time: 0.3 do
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.1, startup_wait_time: 0.4 do
before do
run_command('aruba-test-cli')
last_command_started.send_signal 'HUP'
Expand Down Expand Up @@ -154,7 +154,7 @@ Feature: Run command
"""ruby
require 'spec_helper'
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.3 do
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.4 do
before { run_command('aruba-test-cli') }
it 'runs the command with the expected results' do
Expand All @@ -178,7 +178,7 @@ Feature: Run command
#!/usr/bin/env bash
function initialize_script {
sleep 0.2
sleep 0.3
}
function do_some_work {
Expand Down Expand Up @@ -235,8 +235,8 @@ Feature: Run command
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.1 do
before do
run_command 'aruba-test-cli1', startup_wait_time: 0.3
run_command 'aruba-test-cli2', startup_wait_time: 0.1
run_command 'aruba-test-cli1', startup_wait_time: 0.5
run_command 'aruba-test-cli2', startup_wait_time: 0.2
last_command_started.send_signal 'HUP'
end
Expand Down
4 changes: 2 additions & 2 deletions features/04_aruba_api/command/send_signal_to_command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Send running command a signal
"""ruby
require 'spec_helper'
RSpec.describe 'Run command', type: :aruba, exit_timeout: 1, startup_wait_time: 0.2 do
RSpec.describe 'Run command', type: :aruba, exit_timeout: 1, startup_wait_time: 0.3 do
before { run_command('aruba-test-cli') }
before { last_command_started.send_signal 'HUP' }
it { expect(last_command_started).to have_output /Exit/ }
Expand All @@ -44,7 +44,7 @@ Feature: Send running command a signal
"""ruby
require 'spec_helper'
RSpec.describe 'Run command', type: :aruba, exit_timeout: 1, startup_wait_time: 0.1 do
RSpec.describe 'Run command', type: :aruba, exit_timeout: 1, startup_wait_time: 0.2 do
before { run_command('aruba-test-cli') }
it { expect { last_command_started.send_signal 'HUP' }.to raise_error Aruba::CommandAlreadyStoppedError, /Command "aruba-test-cli" with PID/ }
end
Expand Down
2 changes: 1 addition & 1 deletion features/04_aruba_api/command/stop_single_command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Feature: Stop command
"""ruby
require 'spec_helper'
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.2 do
RSpec.describe 'Run command', type: :aruba, startup_wait_time: 0.1, exit_timeout: 0.3 do
before { run_command('aruba-test-cli') }
before { find_command('aruba-test-cli').stop }
it { expect(last_command_started).to be_successfully_executed }
Expand Down

0 comments on commit d4d76b7

Please sign in to comment.