Created
July 22, 2019 23:31
-
-
Save twalpole/ab163ea5f680306a50f554ecd62f3d6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'selenium-webdriver', '3.142.3' | |
end | |
pid = Process.pid | |
puts "pid: #{pid}" | |
puts `lsof -p #{pid} | grep TCP` | |
require 'selenium-webdriver' | |
def new_driver | |
driver_options = Selenium::WebDriver::Chrome::Options.new() | |
driver_capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(loggingPrefs: {performance: 'ALL'}) | |
Selenium::WebDriver.for :chrome, | |
listener: -> (event_name, *args) { puts "heard #{event_name}, #{args}" }, | |
options: driver_options, | |
desired_capabilities: driver_capabilities | |
end | |
10.times { new_driver.quit } | |
puts 'Pre GC' | |
puts `lsof -p #{pid} | grep TCP` | |
GC.start | |
puts 'After GC' | |
puts `lsof -p #{pid} | grep TCP` | |
puts "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment