fluentd 1.14.6-x64-mingw-ucrt → 1.15.0-x64-mingw-ucrt

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.

Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/linux-test.yaml +1 -1
  3. data/.github/workflows/windows-test.yaml +4 -1
  4. data/CHANGELOG.md +53 -1
  5. data/fluentd.gemspec +2 -1
  6. data/lib/fluent/command/ctl.rb +4 -1
  7. data/lib/fluent/command/fluentd.rb +10 -0
  8. data/lib/fluent/config/literal_parser.rb +2 -2
  9. data/lib/fluent/config/yaml_parser/fluent_value.rb +47 -0
  10. data/lib/fluent/config/yaml_parser/loader.rb +91 -0
  11. data/lib/fluent/config/yaml_parser/parser.rb +166 -0
  12. data/lib/fluent/config/yaml_parser/section_builder.rb +107 -0
  13. data/lib/fluent/config/yaml_parser.rb +56 -0
  14. data/lib/fluent/config.rb +14 -1
  15. data/lib/fluent/plugin/file_wrapper.rb +52 -107
  16. data/lib/fluent/plugin/in_tail/group_watch.rb +204 -0
  17. data/lib/fluent/plugin/in_tail/position_file.rb +1 -15
  18. data/lib/fluent/plugin/in_tail.rb +66 -47
  19. data/lib/fluent/plugin/out_forward/socket_cache.rb +2 -0
  20. data/lib/fluent/plugin/output.rb +2 -1
  21. data/lib/fluent/plugin/parser_syslog.rb +1 -1
  22. data/lib/fluent/plugin_helper/server.rb +3 -1
  23. data/lib/fluent/plugin_helper/service_discovery.rb +2 -2
  24. data/lib/fluent/supervisor.rb +109 -25
  25. data/lib/fluent/system_config.rb +2 -1
  26. data/lib/fluent/version.rb +1 -1
  27. data/lib/fluent/winsvc.rb +2 -0
  28. data/test/command/test_ctl.rb +0 -1
  29. data/test/command/test_fluentd.rb +33 -0
  30. data/test/config/test_system_config.rb +3 -1
  31. data/test/config/test_types.rb +1 -1
  32. data/test/plugin/in_tail/test_io_handler.rb +14 -4
  33. data/test/plugin/in_tail/test_position_file.rb +0 -63
  34. data/test/plugin/out_forward/test_socket_cache.rb +26 -1
  35. data/test/plugin/test_file_wrapper.rb +0 -68
  36. data/test/plugin/test_in_object_space.rb +9 -3
  37. data/test/plugin/test_in_syslog.rb +1 -1
  38. data/test/plugin/test_in_tail.rb +629 -353
  39. data/test/plugin/test_out_forward.rb +30 -20
  40. data/test/plugin/test_parser_syslog.rb +1 -1
  41. data/test/plugin_helper/test_cert_option.rb +1 -1
  42. data/test/plugin_helper/test_child_process.rb +16 -4
  43. data/test/test_config.rb +135 -4
  44. data/test/test_supervisor.rb +155 -0
  45. metadata +25 -5
@@ -17,58 +17,6 @@ class FileWrapperTest < Test::Unit::TestCase
17
17
  FileUtils.rm_rf(TMP_DIR)
18
18
  end
19
19
 
20
- sub_test_case 'Win32Error' do
21
- test 'equal' do
22
- assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "message"),
23
- Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "message"))
24
- end
25
-
26
- test 'different error code' do
27
- assert_not_equal(Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND),
28
- Fluent::Win32Error.new(ERROR_SHARING_VIOLATION))
29
- end
30
-
31
- test 'different error message' do
32
- assert_not_equal(Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND, "message1"),
33
- Fluent::Win32Error.new(ERROR_FILE_NOT_FOUND, "message2"))
34
- end
35
-
36
- test 'different class' do
37
- assert_not_equal(Errno::EPIPE,
38
- Fluent::Win32Error.new(ERROR_SHARING_VIOLATION))
39
- end
40
-
41
- test 'ERROR_SHARING_VIOLATION message' do
42
- assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION).message,
43
- "Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process.")
44
- end
45
-
46
- test 'ERROR_SHARING_VIOLATION with a message' do
47
- assert_equal(Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "cannot open the file").message,
48
- "Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process." +
49
- " - cannot open the file")
50
- end
51
-
52
- test 'to_s' do
53
- assert_equal("Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process. - C:\file.txt",
54
- Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "C:\file.txt").to_s)
55
- end
56
-
57
- test 'inspect' do
58
- assert_equal("#<Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process. - C:\file.txt>",
59
- Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, "C:\file.txt").inspect)
60
- end
61
-
62
- data('0' => [false, 0],
63
- '9999' => [false, 9999],
64
- '10000' => [true, 10000],
65
- '10001' => [true, 10001])
66
- test 'wsaerr?' do |data|
67
- expected, code = data
68
- assert_equal(expected, Fluent::Win32Error.new(code).wsaerr?)
69
- end
70
- end
71
-
72
20
  sub_test_case 'WindowsFile exceptions' do
73
21
  test 'nothing raised' do
74
22
  begin
@@ -106,21 +54,5 @@ class FileWrapperTest < Test::Unit::TestCase
106
54
  file.close if file
107
55
  end
108
56
  end
109
-
110
- test 'ERROR_SHARING_VIOLATION raised' do
111
- begin
112
- path = "#{TMP_DIR}/test_windows_file.txt"
113
- file1 = file2 = nil
114
- file1 = File.open(path, "wb")
115
- win32err = Fluent::Win32Error.new(ERROR_SHARING_VIOLATION, path)
116
- assert_raise(Errno::EACCES.new(win32err.message)) do
117
- file2 = Fluent::WindowsFile.new(path, 'r', FILE_SHARE_READ)
118
- ensure
119
- file2.close if file2
120
- end
121
- ensure
122
- file1.close if file1
123
- end
124
- end
125
57
  end
126
58
  end if Fluent.windows?
@@ -17,13 +17,19 @@ class ObjectSpaceInputTest < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  class FailObject
20
- def self.class
21
- raise "error"
22
- end
23
20
  end
24
21
 
25
22
  def setup
26
23
  Fluent::Test.setup
24
+ # Overriding this behavior in the global scope will have an unexpected influence on other tests.
25
+ # So this should be overridden here and be removed in `teardown`.
26
+ def FailObject.class
27
+ raise "FailObject error for tests in ObjectSpaceInputTest."
28
+ end
29
+ end
30
+
31
+ def teardown
32
+ FailObject.singleton_class.remove_method(:class)
27
33
  end
28
34
 
29
35
  TESTCONFIG = %[
@@ -497,7 +497,7 @@ EOS
497
497
 
498
498
  def test_send_keepalive_packet_can_not_be_enabled_for_udp
499
499
  assert_raise(Fluent::ConfigError) do
500
- d = create_driver(ipv4_config + %[
500
+ create_driver(ipv4_config + %[
501
501
  send_keepalive_packet true
502
502
  ])
503
503
  end