Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_child_process: Try to fix unstable tests #3787

Merged
merged 1 commit into from Jun 15, 2022

Conversation

ashie
Copy link
Member

@ashie ashie commented Jun 15, 2022

On CI environment, these tests sometimes observe unexepected 3rd command
invocation due to delayed shutdown:

2022-06-13T23:57:56.4703110Z Failure: test: can execute external command many times, with leading once executed immediately(ChildProcessTest)
2022-06-13T23:57:56.4704700Z /Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:345:in `block (2 levels) in <class:ChildProcessTest>'
2022-06-13T23:57:56.4705540Z      342:       end
2022-06-13T23:57:56.4706110Z      343:       sleep 1.9 # 1sec(second invocation) + 0.9sec
2022-06-13T23:57:56.4706880Z      344:       @d.stop; @d.shutdown; @d.close; @d.terminate
2022-06-13T23:57:56.4707620Z   => 345:       assert_equal 2, ary.size
2022-06-13T23:57:56.4708220Z      346:       assert_equal [], @d.log.out.logs
2022-06-13T23:57:56.4708800Z      347:     end
2022-06-13T23:57:56.4709330Z      348:   end
2022-06-13T23:57:56.4709970Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
2022-06-13T23:57:56.4710800Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `block in catch'
2022-06-13T23:57:56.4711540Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
2022-06-13T23:57:56.4712240Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
2022-06-13T23:57:56.4712940Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:110:in `timeout'
2022-06-13T23:57:56.4713660Z /Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:339:in `block in <class:ChildProcessTest>'
2022-06-13T23:57:56.4714530Z <2> expected but was
2022-06-13T23:57:56.4715340Z <3>

To avoid it, check only 1st & 2nd elapsed time.

Signed-off-by: Takuro Ashie ashie@clear-code.com

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:

Docs Changes:

Release Note:

@ashie ashie force-pushed the try-to-fix-unstable-child-process-tests branch from 06f59bd to 6ff5fd9 Compare June 15, 2022 09:30
On CI environment, these tests sometimes observe unexepected 3rd command
invocation due to delayed shutdown:

```
2022-06-13T23:57:56.4703110Z Failure: test: can execute external command many times, with leading once executed immediately(ChildProcessTest)
2022-06-13T23:57:56.4704700Z /Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:345:in `block (2 levels) in <class:ChildProcessTest>'
2022-06-13T23:57:56.4705540Z      342:       end
2022-06-13T23:57:56.4706110Z      343:       sleep 1.9 # 1sec(second invocation) + 0.9sec
2022-06-13T23:57:56.4706880Z      344:       @d.stop; @d.shutdown; @d.close; @d.terminate
2022-06-13T23:57:56.4707620Z   => 345:       assert_equal 2, ary.size
2022-06-13T23:57:56.4708220Z      346:       assert_equal [], @d.log.out.logs
2022-06-13T23:57:56.4708800Z      347:     end
2022-06-13T23:57:56.4709330Z      348:   end
2022-06-13T23:57:56.4709970Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
2022-06-13T23:57:56.4710800Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `block in catch'
2022-06-13T23:57:56.4711540Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
2022-06-13T23:57:56.4712240Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
2022-06-13T23:57:56.4712940Z /Users/runner/hostedtoolcache/Ruby/2.7.6/x64/lib/ruby/2.7.0/timeout.rb:110:in `timeout'
2022-06-13T23:57:56.4713660Z /Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:339:in `block in <class:ChildProcessTest>'
2022-06-13T23:57:56.4714530Z <2> expected but was
2022-06-13T23:57:56.4715340Z <3>
```

To avoid it, check only 1st & 2nd elapsed time.

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant