fluentd 1.14.5-x86-mingw32 → 1.14.6-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

@@ -64,6 +64,24 @@ class ServerPluginHelperTest < Test::Unit::TestCase
64
64
  end
65
65
  assert d.plugin_id
66
66
  assert d.log
67
+ assert_equal 0, d.transport_config.linger_timeout
68
+ end
69
+
70
+ test 'can change linger_timeout option' do
71
+ d = Dummy.new
72
+
73
+ transport_opts = {
74
+ 'linger_timeout' => 1,
75
+ }
76
+ transport_conf = config_element('transport', 'tcp', transport_opts)
77
+ conf = config_element('source', 'tag.*', {}, [transport_conf])
78
+
79
+ assert_nothing_raised do
80
+ d.configure(conf)
81
+ end
82
+ assert d.plugin_id
83
+ assert d.log
84
+ assert_equal 1, d.transport_config.linger_timeout
67
85
  end
68
86
  end
69
87
 
@@ -326,6 +326,23 @@ class EventRouterTest < ::Test::Unit::TestCase
326
326
  event_router.emit('test', Engine.now, 'k' => 'v')
327
327
  end
328
328
  end
329
+
330
+ test 'can pass records modified by filters to handle_emits_error' do
331
+ filter = Class.new(FluentTestFilter) {
332
+ def filter_stream(_tag, es); end
333
+ }.new
334
+ event_router.add_rule('test', filter)
335
+ event_router.add_rule('test', error_output)
336
+
337
+ time = Engine.now
338
+ modified_es = OneEventStream.new(time, 'modified_label' => 'modified_value')
339
+
340
+ assert_rr do
341
+ stub(filter).filter_stream { modified_es }
342
+ mock(emit_handler).handle_emits_error('test', modified_es, is_a(RuntimeError))
343
+ event_router.emit('test', time, 'pre_label' => 'pre_value')
344
+ end
345
+ end
329
346
  end
330
347
  end
331
348
  end
@@ -213,16 +213,22 @@ class SupervisorTest < ::Test::Unit::TestCase
213
213
  $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
214
214
  end
215
215
 
216
- def test_rpc_server
216
+ data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
217
+ :ipv6 => ["[::]", "[::1]", true],
218
+ :localhost_ipv4 => ["localhost", "127.0.0.1", false])
219
+ def test_rpc_server(data)
217
220
  omit "Windows cannot handle signals" if Fluent.windows?
218
221
 
222
+ bindaddr, localhost, ipv6 = data
223
+ omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
224
+
219
225
  create_info_dummy_logger
220
226
 
221
227
  opts = Fluent::Supervisor.default_options
222
228
  sv = Fluent::Supervisor.new(opts)
223
229
  conf_data = <<-EOC
224
230
  <system>
225
- rpc_endpoint 0.0.0.0:24447
231
+ rpc_endpoint "#{bindaddr}:24447"
226
232
  </system>
227
233
  EOC
228
234
  conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
@@ -235,7 +241,7 @@ class SupervisorTest < ::Test::Unit::TestCase
235
241
  server.run_rpc_server
236
242
 
237
243
  sv.send(:install_main_process_signal_handlers)
238
- response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
244
+ response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
239
245
  info_msg = '[info]: force flushing buffered events' + "\n"
240
246
 
241
247
  server.stop_rpc_server
@@ -250,16 +256,45 @@ class SupervisorTest < ::Test::Unit::TestCase
250
256
  $log.out.reset if $log.out.is_a?(Fluent::Test::DummyLogDevice)
251
257
  end
252
258
 
253
- def test_rpc_server_windows
259
+ data(:no_port => ["127.0.0.1"],
260
+ :invalid_addr => ["*:24447"])
261
+ def test_invalid_rpc_endpoint(data)
262
+ endpoint = data[0]
263
+
264
+ opts = Fluent::Supervisor.default_options
265
+ sv = Fluent::Supervisor.new(opts)
266
+ conf_data = <<-EOC
267
+ <system>
268
+ rpc_endpoint "#{endpoint}"
269
+ </system>
270
+ EOC
271
+ conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
272
+ sys_conf = sv.__send__(:build_system_config, conf)
273
+
274
+ server = DummyServer.new
275
+ server.rpc_endpoint = sys_conf.rpc_endpoint
276
+
277
+ assert_raise(Fluent::ConfigError.new("Invalid rpc_endpoint: #{endpoint}")) do
278
+ server.run_rpc_server
279
+ end
280
+ end
281
+
282
+ data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
283
+ :ipv6 => ["[::]", "[::1]", true],
284
+ :localhost_ipv4 => ["localhost", "127.0.0.1", true])
285
+ def test_rpc_server_windows(data)
254
286
  omit "Only for windows platform" unless Fluent.windows?
255
287
 
288
+ bindaddr, localhost, ipv6 = data
289
+ omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
290
+
256
291
  create_info_dummy_logger
257
292
 
258
293
  opts = Fluent::Supervisor.default_options
259
294
  sv = Fluent::Supervisor.new(opts)
260
295
  conf_data = <<-EOC
261
296
  <system>
262
- rpc_endpoint 0.0.0.0:24447
297
+ rpc_endpoint "#{bindaddr}:24447"
263
298
  </system>
264
299
  EOC
265
300
  conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
@@ -277,7 +312,7 @@ class SupervisorTest < ::Test::Unit::TestCase
277
312
  server.run_rpc_server
278
313
 
279
314
  mock(server).restart(true) { nil }
280
- response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
315
+ response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
281
316
 
282
317
  server.stop_rpc_server
283
318
  assert_equal('{"ok":true}', response)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.5
4
+ version: 1.14.6
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2022-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -1049,7 +1049,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1049
1049
  - !ruby/object:Gem::Version
1050
1050
  version: '0'
1051
1051
  requirements: []
1052
- rubygems_version: 3.3.3
1052
+ rubygems_version: 3.3.7
1053
1053
  signing_key:
1054
1054
  specification_version: 4
1055
1055
  summary: Fluentd event collector