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 +4 -4
- data/lib/percy/common/version.rb +1 -1
- data/lib/percy/network_helpers.rb +6 -4
- data/lib/percy/process_helpers.rb +6 -1
- data/lib/percy/stats.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7080fcc4fac57a2f39b2443e4ca8473a30baa536c7d90a62990e24d01d49a1c
|
4
|
+
data.tar.gz: 8116d7e1e95c04d9dc9a6966050aad2e70b8e89a293df6e50940f4c2d75bf673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 497b402af66b77a76d2254b9f433e112d283318c75d0a9d08b545b75ba5d6f33a49a7756cf8dbc53902a02e282e07c597ad37a2eab680d23e9f4a4987aaca4e9
|
7
|
+
data.tar.gz: d78b7f18fbbec3d1e8b72a6b4e3536a31995d6823d94848b99c75cdebe418ae773c11c2d8a371267ae0e2a2e841877150b9ab8f477ba9482bd29332760c8882b
|
data/lib/percy/common/version.rb
CHANGED
@@ -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,
|
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
|
-
|
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
|
-
|
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::
|
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::
|
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.
|
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:
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dogstatsd-ruby
|