Skip to content

Commit

Permalink
[rb] fix #8525 by hardcoding ci runs to only 2 sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Feb 11, 2021
1 parent 0f274cb commit 5e3439d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions rb/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ RSpec/AnyInstance:
Enabled: false

RSpec/BeforeAfterAll:
Exclude:
- 'spec/unit/selenium/webdriver/socket_poller_spec.rb'
Enabled: false

RSpec/ContextWording:
Enabled: false
Expand Down
2 changes: 2 additions & 0 deletions rb/lib/selenium/webdriver/common/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def ci
:jenkins
elsif ENV['APPVEYOR']
:appveyor
elsif ENV['GITHUB_ACTIONS']
:github
end
end

Expand Down
5 changes: 1 addition & 4 deletions rb/spec/integration/selenium/webdriver/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
module Selenium
module WebDriver
describe Driver do
it_behaves_like 'driver that can be started concurrently', exclude: [{browser: %i[safari safari_preview]},
{driver: :remote,
platform: :linux,
reason: 8525}]
it_behaves_like 'driver that can be started concurrently', exclude: {browser: %i[safari safari_preview]}

it 'creates default capabilities' do
reset_driver! do |driver|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.

shared_examples_for 'driver that can be started concurrently' do |guard|
before(:all) { quit_driver }

after do
drivers.each(&:quit)
threads.select(&:alive?).each(&:kill)
Expand All @@ -26,8 +28,9 @@
let(:drivers) { [] }
let(:threads) { [] }

it 'starts 3 drivers sequentially', guard do
3.times do
it 'starts multiple drivers sequentially', guard do
expected_count = WebDriver::Platform.ci ? 2 : 4
expected_count.times do
thread = Thread.new do
drivers << create_driver!
end
Expand All @@ -36,7 +39,7 @@
end

expect { threads.each(&:join) }.not_to raise_error
expect(drivers.count).to eq(3)
expect(drivers.count).to eq(expected_count)

# make any wire call
expect { drivers.each(&:title) }.not_to raise_error
Expand Down

0 comments on commit 5e3439d

Please sign in to comment.