Skip to content

Test: TestFluentdCommand often fails on Windows #4095

Description

@daipom

Describe the bug

Recently, TestFluentdCommand often fails on Windows in CI.

Possible fixes that may have caused:

On my local, once it starts to fail, it starts to fail a lot.
It seems that sometimes it can't get the standard output of some processes correctly.

Some processes often remain not killed, and those surviving processes seem to be the cause of this problem.

After killing all surviving Ruby processes, all the tests start to succeed again.

I think the reason the tests fail so frequently these days is because the number of tests increases in #4064.

To Reproduce

Repeat the following several times.

$ bundle exec rake test TESTOPTS='-t"TestFluentdCommand"'

Expected behavior

Tests succeed stably.

Your Environment

- Fluentd version: v1.15.3
- Operating system: Windows 10 Home
- Ruby 3.2

Your Configuration

None

Your Error Log

Failure: test: failed to start(TestFluentdCommand::configuration to load plugin which raises unrecoverable error in #start):
  fluentd failed to start, without specified regular expressions:
  2023-03-13 22:27:58 +0900 [info]: init supervisor logger path=nil rotate_age=nil rotate_size=nil
  2023-03-13 22:27:58 +0900 [info]: parsing config file is succeeded path="C:/Users/reang/Documents/work/fluentd/fluentd/test/command/../tmp/commandfluentd/e13266ed6235d47abcf9/crashing_plugin.conf"
  2023-03-13 22:27:58 +0900 [info]: gem 'fluentd' version '1.15.3'
  2023-03-13 22:27:59 +0900 [info]: using configuration file: <ROOT>
    <source>
      @type crashing
      @id dummy
      @label @dummydata
      tag dummy
      dummy {"message":"yay!"}
    </source>
    <label @dummydata>
      <match dummy>
        @type null
        @id blackhole
      </match>
    </label>
  </ROOT>
  2023-03-13 22:27:59 +0900 [info]: starting fluentd-1.15.3 pid=16044 ruby="3.2.0"
  2023-03-13 22:27:59 +0900 [info]: spawn command to main:  cmdline=["C:/Ruby32-x64/bin/ruby.exe", "-rC:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.8/lib/bundler/setup", "-Eutf-8", "C:/Users/reang/Documents/work/fluentd/fluentd/bin/fluentd", "-c", "C:/Users/reang/Documents/work/fluentd/fluentd/test/command/../tmp/commandfluentd/e13266ed6235d47abcf9/crashing_plugin.conf", "-p", "C:/Users/reang/Documents/work/fluentd/fluentd/test/command/../tmp/commandfluentd/e13266ed6235d47abcf9/plugin", "--under-supervisor"]
  .
  <false> is not true.
C:/Users/reang/Documents/work/fluentd/fluentd/test/command/test_fluentd.rb:239:in `assert_fluentd_fails_to_start'
C:/Users/reang/Documents/work/fluentd/fluentd/test/command/test_fluentd.rb:578:in `block (2 levels) in <class:TestFluentdCommand>'

Failure: test: runs successfully(TestFluentdCommand::with --conf-encoding):
  execution timeout.
  <"">
  was expected to include:
  <["fluentd worker is now running", "worker=0"]>
C:/Users/reang/Documents/work/fluentd/fluentd/test/command/test_fluentd.rb:192:in `assert_log_matches'
C:/Users/reang/Documents/work/fluentd/fluentd/test/command/test_fluentd.rb:280:in `block (2 levels) in <class:TestFluentdCommand>'
     277: </match>
     278: CONF
     279:       conf_path = create_conf_file('shift_jis.conf', conf, 'shift_jis')
  => 280:       assert_log_matches(create_cmdline(conf_path, '--conf-encoding', 'shift_jis'), "fluentd worker is now running", 'worker=0')
     281:     end
     282:
     283:     test 'failed to run by invalid encoding' do

......

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions