appsignal 3.0.7 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b30d6aa0276c7bc900b235aa7837d44c11cca8cf4fc81be150c59962636dc42
4
- data.tar.gz: 4ea9db25ed39f99052d8e83a83513a8f75363a028895f15e09e23a18774d633c
3
+ metadata.gz: 6c853a3c0cbc188f19a972dd0af7c8d1f14a40063ef08943f028d59fd6c6f09c
4
+ data.tar.gz: b07e52344f13961121c3427f14d5c87e503287c7e475a3bdffb08303d477c985
5
5
  SHA512:
6
- metadata.gz: 6ac1d744af5f9674baec2985bbbe9ad46bb1c76a068a35b9902261e3d7ff40b0344796c62b90ce50f02ffaeb5b79b15bb4e238885834cbe9058b0791e340ab87
7
- data.tar.gz: f91fcf688355c79d562fabda066473e3942aa1f174f3ce22485a43fe9aac6c530c2200b0f2be0af09a5b2568ca43e9a001d0a0293c5eaea6f989ff83027f709b
6
+ metadata.gz: 87e51924047c8a7e693c24a30acddbeb61b574a59cce900ab22437c061b63a56c3328f6782796f070ca0495e90dfd9a92eebf72eb65bf3e3c1d877d2b621c0b6
7
+ data.tar.gz: 3dbf154339dc4094a73f066440fa84d401aa868474042769529ff249d09721b18b11207ccc18099a9d99e1aae7c50da17b79b7c896dbe42b19419d6b097ce74b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.0.8
4
+
5
+ - [5f94712d](https://github.com/appsignal/appsignal-ruby/commit/5f94712d3406898f58bea133b8bf3578d6fbbe22) patch - Add the `APPSIGNAL_BUILD_FOR_LINUX_ARM` flag to allow users to enable the experimental Linux ARM build for 64-bit hosts. Usage: `export APPSIGNAL_BUILD_FOR_LINUX_ARM=1 bundle install`. Please be aware this is an experimental build. Please report any issue you may encounter at our [support email](mailto:support@appsignal.com).
6
+
3
7
  ## 3.0.7
4
8
 
5
9
  - [27f9b178](https://github.com/appsignal/appsignal-ruby/commit/27f9b178c20006ee15e69bdf878f3a0c9975b1f4) patch - Bump agent to 6caf6d0. Replaces curl HTTP client and includes various other maintenance updates.
data/ext/agent.yml CHANGED
@@ -1,62 +1,69 @@
1
1
  ---
2
- version: 3ecd06f
2
+ version: 9f282f3
3
3
  mirrors:
4
4
  - https://appsignal-agent-releases.global.ssl.fastly.net
5
5
  - https://d135dj0rjqvssy.cloudfront.net
6
6
  triples:
7
7
  x86_64-darwin:
8
8
  static:
9
- checksum: 39839e64832d7964fad51d9acc95374654446ade04d06cbba4d052e4483a8516
9
+ checksum: c279d061ac04b53c8e2ea21b7714d4d54964495124ddc7e794ba998366f9c195
10
10
  filename: appsignal-x86_64-darwin-all-static.tar.gz
11
11
  dynamic:
12
- checksum: 841b82677aaf553219f689b92b6dc6988278420e2e72dcab28a6c5915a0e4158
12
+ checksum: 52284dd2e073e5252363f18f8668cf17d82befe65bfa4376f8d4f61f6e08ece9
13
13
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
14
14
  universal-darwin:
15
15
  static:
16
- checksum: 39839e64832d7964fad51d9acc95374654446ade04d06cbba4d052e4483a8516
16
+ checksum: c279d061ac04b53c8e2ea21b7714d4d54964495124ddc7e794ba998366f9c195
17
17
  filename: appsignal-x86_64-darwin-all-static.tar.gz
18
18
  dynamic:
19
- checksum: 841b82677aaf553219f689b92b6dc6988278420e2e72dcab28a6c5915a0e4158
19
+ checksum: 52284dd2e073e5252363f18f8668cf17d82befe65bfa4376f8d4f61f6e08ece9
20
20
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
21
+ aarch64-linux:
22
+ static:
23
+ checksum: 3054b6e3bcab8c8959d4e87eb6fd9fc7a5821e0986c8e733154c2b76251c9e70
24
+ filename: appsignal-aarch64-linux-all-static.tar.gz
25
+ dynamic:
26
+ checksum: 50f96493c1d81dbb0910581598e0d97a8567a3bc6b27a17dbb14d01c97bf7b7c
27
+ filename: appsignal-aarch64-linux-all-dynamic.tar.gz
21
28
  i686-linux:
22
29
  static:
23
- checksum: fdf923153992816c813f938f41feadafbf80d8fa10a785123ee23184945047a0
30
+ checksum: 30554989a59632cdaf8fdf5d15024b866d32930e91c080425955842e8078952b
24
31
  filename: appsignal-i686-linux-all-static.tar.gz
25
32
  dynamic:
26
- checksum: d2b8635199a73a1769ee7495acac0cdc69c4f964fef9ec7749fde517d789e1dd
33
+ checksum: 437e24a97738995375c18559220fc30b6b9599cfc9339d5a410225e7fdfeb875
27
34
  filename: appsignal-i686-linux-all-dynamic.tar.gz
28
35
  x86-linux:
29
36
  static:
30
- checksum: fdf923153992816c813f938f41feadafbf80d8fa10a785123ee23184945047a0
37
+ checksum: 30554989a59632cdaf8fdf5d15024b866d32930e91c080425955842e8078952b
31
38
  filename: appsignal-i686-linux-all-static.tar.gz
32
39
  dynamic:
33
- checksum: d2b8635199a73a1769ee7495acac0cdc69c4f964fef9ec7749fde517d789e1dd
40
+ checksum: 437e24a97738995375c18559220fc30b6b9599cfc9339d5a410225e7fdfeb875
34
41
  filename: appsignal-i686-linux-all-dynamic.tar.gz
35
42
  x86_64-linux:
36
43
  static:
37
- checksum: d81383dedb228f484e1d1e28a76ddc017d788fa62270b6e3f5a55765a4fb89d9
44
+ checksum: f11fa7ec493c3668e965ef4cff077d44fe55101197a5eeaf50ccacf7314eba2b
38
45
  filename: appsignal-x86_64-linux-all-static.tar.gz
39
46
  dynamic:
40
- checksum: f98948600345ee4726712937b13059fe7145d9b83273fc6efc6e0fd6a255381a
47
+ checksum: bc7991b388eb541eddc26d8272738b4d9befa594f4b73a222b425e0ee7b6157d
41
48
  filename: appsignal-x86_64-linux-all-dynamic.tar.gz
42
49
  x86_64-linux-musl:
43
50
  static:
44
- checksum: be2c414da7eb0837f23a8791b369e650aea26afbf9d3be9f530bc2de11fc888f
51
+ checksum: 0dae02e77e244275b69bb8332e79bdcb0e0fa3b6b6f84744780ce0baffa9784f
45
52
  filename: appsignal-x86_64-linux-musl-all-static.tar.gz
46
53
  dynamic:
47
- checksum: 3d04b9dcfbfe7696e028f9205dcae08e41bd87d162f7f37d04cc3d4a7442a9ec
54
+ checksum: a56f3e3cb6e30e638f91f14ba69ae1b5086bb566dedb6f0c630be24834a8fd4f
48
55
  filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
49
56
  x86_64-freebsd:
50
57
  static:
51
- checksum: fcbfabaa51f9004ed697e9000bfc1a7d71f48f40c04f9c9588a5c8f09cddf0ea
58
+ checksum: d9146a04bbbb85dccf22c84cacfa924ee8b7e2ff8ed79402aba14ac4333e440f
52
59
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
53
60
  dynamic:
54
- checksum: ffc261d6d2a799e9bbf1cee3f9134da60cd72cd6b47a72e8c63a5a11e4d0b472
61
+ checksum: e231e106695160525e3f920e781c37f9d5875a3eacc18c38a0264c4b7f9c69bf
55
62
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
56
63
  amd64-freebsd:
57
64
  static:
58
- checksum: fcbfabaa51f9004ed697e9000bfc1a7d71f48f40c04f9c9588a5c8f09cddf0ea
65
+ checksum: d9146a04bbbb85dccf22c84cacfa924ee8b7e2ff8ed79402aba14ac4333e440f
59
66
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
60
67
  dynamic:
61
- checksum: ffc261d6d2a799e9bbf1cee3f9134da60cd72cd6b47a72e8c63a5a11e4d0b472
68
+ checksum: e231e106695160525e3f920e781c37f9d5875a3eacc18c38a0264c4b7f9c69bf
62
69
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
data/ext/base.rb CHANGED
@@ -11,8 +11,9 @@ EXT_PATH = File.expand_path("..", __FILE__).freeze
11
11
  AGENT_CONFIG = YAML.load(File.read(File.join(EXT_PATH, "agent.yml"))).freeze
12
12
 
13
13
  AGENT_PLATFORM = Appsignal::System.agent_platform
14
- ARCH = "#{RbConfig::CONFIG["host_cpu"]}-#{AGENT_PLATFORM}".freeze
15
- ARCH_CONFIG = AGENT_CONFIG["triples"][ARCH].freeze
14
+ AGENT_ARCHITECTURE = Appsignal::System.agent_architecture
15
+ TARGET_TRIPLE = "#{AGENT_ARCHITECTURE}-#{AGENT_PLATFORM}".freeze
16
+ ARCH_CONFIG = AGENT_CONFIG["triples"][TARGET_TRIPLE].freeze
16
17
  CA_CERT_PATH = File.join(EXT_PATH, "../resources/cacert.pem").freeze
17
18
 
18
19
  def ext_path(path)
@@ -38,9 +39,10 @@ def report
38
39
  "build" => {
39
40
  "time" => Time.now.utc,
40
41
  "package_path" => File.dirname(EXT_PATH),
41
- "architecture" => rbconfig["host_cpu"],
42
+ "architecture" => AGENT_ARCHITECTURE,
42
43
  "target" => AGENT_PLATFORM,
43
44
  "musl_override" => Appsignal::System.force_musl_build?,
45
+ "linux_arm_override" => Appsignal::System.force_linux_arm_build?,
44
46
  "dependencies" => {},
45
47
  "flags" => {}
46
48
  },
@@ -94,11 +96,11 @@ def installation_succeeded?
94
96
  end
95
97
 
96
98
  def check_architecture
97
- if AGENT_CONFIG["triples"].key?(ARCH)
99
+ if AGENT_CONFIG["triples"].key?(TARGET_TRIPLE)
98
100
  true
99
101
  else
100
102
  abort_installation(
101
- "AppSignal currently does not support your system architecture (#{ARCH})." \
103
+ "AppSignal currently does not support your system architecture (#{TARGET_TRIPLE})." \
102
104
  "Please let us know at support@appsignal.com, we aim to support everything our customers run."
103
105
  )
104
106
  end
@@ -399,6 +399,7 @@ module Appsignal
399
399
  puts " Architecture: #{report["architecture"]}"
400
400
  puts " Target: #{report["target"]}"
401
401
  puts " Musl override: #{report["musl_override"]}"
402
+ puts " Linux ARM override: #{report["linux_arm_override"]}"
402
403
  puts " Library type: #{report["library_type"]}"
403
404
  puts " Source: #{report["source"]}" if report["source"] != "remote"
404
405
  puts " Dependencies: #{report["dependencies"]}"
@@ -416,7 +417,7 @@ module Appsignal
416
417
  rbconfig = RbConfig::CONFIG
417
418
  puts "Host information"
418
419
  data_section :host do
419
- puts_and_save :architecture, "Architecture", rbconfig["host_cpu"]
420
+ puts_and_save :architecture, "Architecture", Appsignal::System.agent_architecture
420
421
 
421
422
  os_label = os = rbconfig["host_os"]
422
423
  os_label = "#{os} (Microsoft Windows is not supported.)" if Gem.win_platform?
@@ -8,6 +8,7 @@ module Appsignal
8
8
  # @api private
9
9
  module System
10
10
  LINUX_TARGET = "linux".freeze
11
+ LINUX_ARM_ARCHITECTURE = "aarch64".freeze
11
12
  MUSL_TARGET = "linux-musl".freeze
12
13
  FREEBSD_TARGET = "freebsd".freeze
13
14
  GEM_EXT_PATH = File.expand_path("../../../ext", __FILE__).freeze
@@ -18,15 +19,18 @@ module Appsignal
18
19
 
19
20
  # Detect agent and extension platform build
20
21
  #
21
- # Used by `ext/extconf.rb` to select which build it should download and
22
+ # Used by `ext/*` to select which build it should download and
22
23
  # install.
23
24
  #
24
- # Use `export APPSIGNAL_BUILD_FOR_MUSL=1` if the detection doesn't work
25
- # and to force selection of the musl build.
25
+ # - Use `export APPSIGNAL_BUILD_FOR_MUSL=1` if the detection doesn't work
26
+ # and to force selection of the musl build.
27
+ # - Use `export APPSIGNAL_BUILD_FOR_LINUX_ARM=1` to enable the experimental
28
+ # Linux ARM build.
26
29
  #
27
30
  # @api private
28
31
  # @return [String]
29
32
  def self.agent_platform
33
+ return LINUX_TARGET if force_linux_arm_build?
30
34
  return MUSL_TARGET if force_musl_build?
31
35
 
32
36
  host_os = RbConfig::CONFIG["host_os"].downcase
@@ -53,6 +57,22 @@ module Appsignal
53
57
  local_os
54
58
  end
55
59
 
60
+ # Detect agent and extension architecture build
61
+ #
62
+ # Used by the `ext/*` tasks to select which architecture build it should download and install.
63
+ #
64
+ # - Use `export APPSIGNAL_BUILD_FOR_LINUX_ARM=1` to enable the experimental
65
+ # Linux ARM build.
66
+ #
67
+ # @api private
68
+ # @return [String]
69
+ def self.agent_architecture
70
+ return LINUX_ARM_ARCHITECTURE if force_linux_arm_build?
71
+
72
+ # Fallback on the Ruby
73
+ RbConfig::CONFIG["host_cpu"]
74
+ end
75
+
56
76
  # Returns whether or not the musl build was forced by the user.
57
77
  #
58
78
  # @api private
@@ -60,6 +80,13 @@ module Appsignal
60
80
  %w[true 1].include?(ENV["APPSIGNAL_BUILD_FOR_MUSL"])
61
81
  end
62
82
 
83
+ # Returns whether or not the linux ARM build was selected by the user.
84
+ #
85
+ # @api private
86
+ def self.force_linux_arm_build?
87
+ %w[true 1].include?(ENV["APPSIGNAL_BUILD_FOR_LINUX_ARM"])
88
+ end
89
+
63
90
  # @api private
64
91
  def self.versionify(version)
65
92
  Gem::Version.new(version)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.0.7".freeze
4
+ VERSION = "3.0.8".freeze
5
5
  end
@@ -270,9 +270,10 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
270
270
  "build" => {
271
271
  "time" => kind_of(String),
272
272
  "package_path" => File.expand_path("../../../../../", __FILE__),
273
- "architecture" => rbconfig["host_cpu"],
273
+ "architecture" => Appsignal::System.agent_architecture,
274
274
  "target" => Appsignal::System.agent_platform,
275
275
  "musl_override" => false,
276
+ "linux_arm_override" => false,
276
277
  "library_type" => jruby ? "dynamic" : "static",
277
278
  "source" => "remote",
278
279
  "dependencies" => kind_of(Hash),
@@ -301,9 +302,10 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
301
302
  " Checksum: verified",
302
303
  "Build details",
303
304
  " Install time: 20",
304
- " Architecture: #{rbconfig["host_cpu"]}",
305
+ " Architecture: #{Appsignal::System.agent_architecture}",
305
306
  " Target: #{Appsignal::System.agent_platform}",
306
307
  " Musl override: false",
308
+ " Linux ARM override: false",
307
309
  " Library type: #{jruby ? "dynamic" : "static"}",
308
310
  " Dependencies: {",
309
311
  " Flags: {",
@@ -43,6 +43,14 @@ describe Appsignal::System do
43
43
  end
44
44
  end
45
45
 
46
+ context "when using the APPSIGNAL_BUILD_FOR_LINUX_ARM env var" do
47
+ it "returns the linux build" do
48
+ ENV["APPSIGNAL_BUILD_FOR_LINUX_ARM"] = "1"
49
+ is_expected.to eq("linux")
50
+ ENV.delete("APPSIGNAL_BUILD_FOR_LINUX_ARM")
51
+ end
52
+ end
53
+
46
54
  context "when on a musl system" do
47
55
  let(:ldd_output) { "musl libc (x86_64)\nVersion 1.1.16" }
48
56
 
@@ -93,4 +101,26 @@ describe Appsignal::System do
93
101
  end
94
102
  end
95
103
  end
104
+
105
+ describe ".agent_architecture" do
106
+ let(:architecture) { "x86_64" }
107
+ let(:ldd_output) { "" }
108
+ before do
109
+ allow(RbConfig::CONFIG).to receive(:[])
110
+ allow(RbConfig::CONFIG).to receive(:[]).with("host_cpu").and_return(architecture)
111
+ end
112
+ subject { described_class.agent_architecture }
113
+
114
+ it "returns the host CPU value" do
115
+ is_expected.to eq(architecture)
116
+ end
117
+
118
+ context "when using the APPSIGNAL_BUILD_FOR_LINUX_ARM env var" do
119
+ it "returns ARM 64 bit" do
120
+ ENV["APPSIGNAL_BUILD_FOR_LINUX_ARM"] = "1"
121
+ is_expected.to eq("aarch64")
122
+ ENV.delete("APPSIGNAL_BUILD_FOR_LINUX_ARM")
123
+ end
124
+ end
125
+ end
96
126
  end
@@ -1,4 +1,6 @@
1
1
  RSpec.describe "Puma plugin" do
2
+ include WaitForHelper
3
+
2
4
  class MockPumaLauncher
3
5
  def events
4
6
  return @events if defined?(@events)
@@ -50,7 +52,7 @@ RSpec.describe "Puma plugin" do
50
52
  end
51
53
 
52
54
  def stop
53
- @socket && @socket.close
55
+ defined?(@socket) && @socket && @socket.close
54
56
  ensure
55
57
  @socket = nil
56
58
  end
@@ -72,6 +74,9 @@ RSpec.describe "Puma plugin" do
72
74
  let(:hostname) { Socket.gethostname }
73
75
  let(:expected_default_tags) { { "hostname" => hostname } }
74
76
  let(:stats_data) { { :backlog => 1 } }
77
+ before :context do
78
+ Appsignal.stop
79
+ end
75
80
  before do
76
81
  module Puma
77
82
  def self.stats
@@ -117,10 +122,10 @@ RSpec.describe "Puma plugin" do
117
122
  Object.send(:remove_const, :AppsignalPumaPlugin)
118
123
  end
119
124
 
120
- def run(plugin)
125
+ def run_plugin(plugin, &block)
121
126
  @client_thread = Thread.new { start_plugin(plugin) }
122
127
  @client_thread.abort_on_exception = true
123
- sleep 0.03
128
+ wait_for(:puma_client_wait, &block)
124
129
  ensure
125
130
  stop_all
126
131
  end
@@ -206,16 +211,16 @@ RSpec.describe "Puma plugin" do
206
211
  end
207
212
 
208
213
  it "collects puma stats as guage metrics with the (summed) worker metrics" do
209
- run(appsignal_plugin)
210
-
211
- expect(logs).to_not include([:error, kind_of(String)])
212
- expect_gauge(:workers, 2, "type" => "count")
213
- expect_gauge(:workers, 2, "type" => "booted")
214
- expect_gauge(:workers, 0, "type" => "old")
215
- expect_gauge(:connection_backlog, 0)
216
- expect_gauge(:pool_capacity, 10)
217
- expect_gauge(:threads, 10, "type" => "running")
218
- expect_gauge(:threads, 10, "type" => "max")
214
+ run_plugin(appsignal_plugin) do
215
+ expect(logs).to_not include([:error, kind_of(String)])
216
+ expect_gauge(:workers, 2, "type" => "count")
217
+ expect_gauge(:workers, 2, "type" => "booted")
218
+ expect_gauge(:workers, 0, "type" => "old")
219
+ expect_gauge(:connection_backlog, 0)
220
+ expect_gauge(:pool_capacity, 10)
221
+ expect_gauge(:threads, 10, "type" => "running")
222
+ expect_gauge(:threads, 10, "type" => "max")
223
+ end
219
224
  end
220
225
  end
221
226
 
@@ -230,13 +235,13 @@ RSpec.describe "Puma plugin" do
230
235
  end
231
236
 
232
237
  it "calls `puma_gauge` with the (summed) worker metrics" do
233
- run(appsignal_plugin)
234
-
235
- expect(logs).to_not include([:error, kind_of(String)])
236
- expect_gauge(:connection_backlog, 0)
237
- expect_gauge(:pool_capacity, 5)
238
- expect_gauge(:threads, 5, "type" => "running")
239
- expect_gauge(:threads, 5, "type" => "max")
238
+ run_plugin(appsignal_plugin) do
239
+ expect(logs).to_not include([:error, kind_of(String)])
240
+ expect_gauge(:connection_backlog, 0)
241
+ expect_gauge(:pool_capacity, 5)
242
+ expect_gauge(:threads, 5, "type" => "running")
243
+ expect_gauge(:threads, 5, "type" => "max")
244
+ end
240
245
  end
241
246
  end
242
247
 
@@ -246,10 +251,10 @@ RSpec.describe "Puma plugin" do
246
251
  after { ENV.delete("APPSIGNAL_HOSTNAME") }
247
252
 
248
253
  it "reports the APPSIGNAL_HOSTNAME as the hostname tag value" do
249
- run(appsignal_plugin)
250
-
251
- expect(logs).to_not include([:error, kind_of(String)])
252
- expect_gauge(:connection_backlog, 1)
254
+ run_plugin(appsignal_plugin) do
255
+ expect(logs).to_not include([:error, kind_of(String)])
256
+ expect_gauge(:connection_backlog, 1)
257
+ end
253
258
  end
254
259
  end
255
260
 
@@ -259,11 +264,11 @@ RSpec.describe "Puma plugin" do
259
264
  end
260
265
 
261
266
  it "fetches metrics from Puma.stats instead" do
262
- run(appsignal_plugin)
263
-
264
- expect(logs).to_not include([:error, kind_of(String)])
265
- expect(logs).to_not include([kind_of(Symbol), "AppSignal: No Puma stats to report."])
266
- expect_gauge(:connection_backlog, 1)
267
+ run_plugin(appsignal_plugin) do
268
+ expect(logs).to_not include([:error, kind_of(String)])
269
+ expect(logs).to_not include([kind_of(Symbol), "AppSignal: No Puma stats to report."])
270
+ expect_gauge(:connection_backlog, 1)
271
+ end
267
272
  end
268
273
  end
269
274
 
@@ -274,22 +279,21 @@ RSpec.describe "Puma plugin" do
274
279
  end
275
280
 
276
281
  it "does not fetch metrics" do
277
- run(appsignal_plugin)
278
-
279
- expect(logs).to_not include([:error, kind_of(String)])
280
- expect(logs).to include([:log, "AppSignal: No Puma stats to report."])
281
- expect(messages).to be_empty
282
+ run_plugin(appsignal_plugin) do
283
+ expect(logs).to_not include([:error, kind_of(String)])
284
+ expect(logs).to include([:log, "AppSignal: No Puma stats to report."])
285
+ expect(messages).to be_empty
286
+ end
282
287
  end
283
288
  end
284
289
 
285
290
  context "without running StatsD server" do
286
291
  it "does nothing" do
287
- Appsignal.stop
288
292
  stop_all
289
- run(appsignal_plugin)
290
-
291
- expect(logs).to_not include([:error, kind_of(String)])
292
- expect(messages).to be_empty
293
+ run_plugin(appsignal_plugin) do
294
+ expect(logs).to_not include([:error, kind_of(String)])
295
+ expect(messages).to be_empty
296
+ end
293
297
  end
294
298
  end
295
299
  end
@@ -16,13 +16,25 @@ module WaitForHelper
16
16
  def wait_for(name)
17
17
  max_wait = 5_000
18
18
  i = 0
19
+ error = nil
19
20
  while i < max_wait
20
- break if yield
21
- i += 1
22
- sleep 0.001
21
+ begin
22
+ result = yield
23
+ break if result
24
+ rescue Exception => e # rubocop:disable Lint/RescueException
25
+ # Capture error so we know if it exited with an error
26
+ error = e
27
+ ensure
28
+ i += 1
29
+ sleep 0.001
30
+ end
23
31
  end
24
32
 
25
33
  return unless i >= max_wait
26
- raise "Waited 5 seconds for #{name} condition, but was not met."
34
+ error_message =
35
+ if error
36
+ "\nError: #{error.class}: #{error.message}\n#{error.backtrace.join("\n")}"
37
+ end
38
+ raise "Waited 5 seconds for #{name} condition, but was not met.#{error_message}"
27
39
  end
28
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-15 00:00:00.000000000 Z
13
+ date: 2021-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack