percy-common 3.1.3 → 3.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce7918aeff2ead877459e0bfd675c86caa2378a0b428dca1c8aaf93d427f276a
4
- data.tar.gz: ed60d47e414a8a9ce3662407ae500bb56bdba6087de7cad21b36473ca8f67487
3
+ metadata.gz: a7080fcc4fac57a2f39b2443e4ca8473a30baa536c7d90a62990e24d01d49a1c
4
+ data.tar.gz: 8116d7e1e95c04d9dc9a6966050aad2e70b8e89a293df6e50940f4c2d75bf673
5
5
  SHA512:
6
- metadata.gz: 4e8461a0a30b248ecf18d009d935a23a5c8a6076e6b2bf2136282b7235428787f8d62e98c5c00bcf1046525dc075995efd5fe47ac5ec076530aa82dc8915a66b
7
- data.tar.gz: 731a137bdc7f022685d42562b2b394689874aeb0087e5e1d9b334d14d64cf1aa8bdf01f55af0dddca33d79625a12c9b2dff271ad04304998a95333c05b481f90
6
+ metadata.gz: 497b402af66b77a76d2254b9f433e112d283318c75d0a9d08b545b75ba5d6f33a49a7756cf8dbc53902a02e282e07c597ad37a2eab680d23e9f4a4987aaca4e9
7
+ data.tar.gz: d78b7f18fbbec3d1e8b72a6b4e3536a31995d6823d94848b99c75cdebe418ae773c11c2d8a371267ae0e2a2e841877150b9ab8f477ba9482bd29332760c8882b
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Common
3
- VERSION = '3.1.3'.freeze
3
+ VERSION = '3.1.6'.freeze
4
4
  end
5
5
  end
@@ -28,10 +28,10 @@ module Percy
28
28
  end
29
29
  end
30
30
 
31
- def self.verify_healthcheck(url:, expected_body: 'ok', retry_wait_seconds: 0.5)
31
+ def self.verify_healthcheck(url:, expected_body: 'ok', retry_wait_seconds: 0.5, proxy: nil)
32
32
  10.times do
33
33
  begin
34
- response = Excon.get(url)
34
+ response = Excon.get(url, proxy: proxy)
35
35
  return true if response.body == expected_body
36
36
  rescue Excon::Error::Socket, Excon::Error::Timeout
37
37
  sleep retry_wait_seconds
@@ -40,10 +40,12 @@ module Percy
40
40
  raise ServerDown, "Healthcheck failed for #{url}"
41
41
  end
42
42
 
43
- def self.verify_http_server_up(hostname, port: nil, path: nil, retry_wait_seconds: 0.25)
43
+ def self.verify_http_server_up(hostname, port: nil,
44
+ path: nil, retry_wait_seconds: 0.25, proxy: nil)
44
45
  10.times do
45
46
  begin
46
- Excon.get("http://#{hostname}#{port.nil? ? '' : ':' + port.to_s}#{path || ''}")
47
+ url = "http://#{hostname}#{port.nil? ? '' : ':' + port.to_s}#{path || ''}"
48
+ Excon.get(url, proxy: proxy)
47
49
  return true
48
50
  rescue Excon::Error::Socket, Excon::Error::Timeout
49
51
  sleep retry_wait_seconds
@@ -17,7 +17,12 @@ module Percy
17
17
  # Status has already been collected, perhaps by a Process.detach thread.
18
18
  return false
19
19
  rescue Timeout::Error
20
- Process.kill('KILL', pid)
20
+ begin
21
+ Process.kill('KILL', pid)
22
+ rescue Errno::ESRCH
23
+ # If the process has already ended, suppress any additional errors
24
+ return false
25
+ end
21
26
  # Collect status so it doesn't stick around as zombie process.
22
27
  Process.wait(pid, Process::WNOHANG)
23
28
  end
data/lib/percy/stats.rb CHANGED
@@ -5,13 +5,13 @@ module Percy
5
5
  class Stats < ::Datadog::Statsd
6
6
  DEFAULT_HOST = ENV.fetch(
7
7
  'DATADOG_AGENT_HOST',
8
- ::Datadog::Statsd::Connection::DEFAULT_HOST,
8
+ ::Datadog::Statsd::UDPConnection::DEFAULT_HOST,
9
9
  )
10
10
 
11
11
  DEFAULT_PORT = Integer(
12
12
  ENV.fetch(
13
13
  'DATADOG_AGENT_PORT',
14
- ::Datadog::Statsd::Connection::DEFAULT_PORT,
14
+ ::Datadog::Statsd::UDPConnection::DEFAULT_PORT,
15
15
  ),
16
16
  )
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dogstatsd-ruby