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

Use teardown instead of shutdown in CounterStoreTest #2550

Merged
merged 1 commit into from Aug 13, 2019

Conversation

@abicky
Copy link
Contributor

commented Aug 10, 2019

Which issue(s) this PR fixes:
No issues

What this PR does / why we need it:

Timecop.return is never called because CounterStoreTest#shutdown is never called.
We shuould define CounterStoreTest.shutdown or CounterStoreTest#teardown.
cf. https://github.com/test-unit/test-unit/blob/3.2.8/lib/test/unit.rb#L462-L473

As you can see, this PR corrects the elapsed time from -90938190.322263 seconds to 0.013861 seconds.

Before

% bundle exec rake TEST=test/counter/test_store.rb
/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/bin/ruby -w -I"lib:test" -Eascii-8bit:ascii-8bit -I"/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib" "/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb" "test/counter/test_store.rb"
/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/thread_pool.rb:106: warning: mismatched indentations at 'rescue' with 'def' at 94
Loaded suite /Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/rake_test_loader
Started
..................
Finished in -90938190.322263 seconds.
----------------------------------------------------------------------------------------------------
18 tests, 53 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
----------------------------------------------------------------------------------------------------
-0.00 tests/s, -0.00 assertions/s
fluentd 1.6.3 built to pkg/fluentd-1.6.3.gem.

After

% bundle exec rake TEST=test/counter/test_store.rb
/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/bin/ruby -w -I"lib:test" -Eascii-8bit:ascii-8bit -I"/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib" "/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb" "test/counter/test_store.rb"
/Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/thread_pool.rb:106: warning: mismatched indentations at 'rescue' with 'def' at 94
Loaded suite /Users/arabiki/.anyenv/envs/rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/rake-11.3.0/lib/rake/rake_test_loader
Started
..................
Finished in 0.013861 seconds.
----------------------------------------------------------------------------------------------------
18 tests, 53 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
----------------------------------------------------------------------------------------------------
1298.61 tests/s, 3823.68 assertions/s
fluentd 1.6.3 built to pkg/fluentd-1.6.3.gem.

Docs Changes:

Release Note:

Use teardown instead of shutdown in CounterStoreTest
`Timecop.return` is never called because
CounterStoreTest#shutdown is never called.
We shuould define CounterStoreTest.shutdown
or CounterStoreTest#teardown.

Signed-off-by: abicky <takeshi.arabiki@gmail.com>

@repeatedly repeatedly merged commit e98772e into fluent:master Aug 13, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
DCO DCO
Details
@repeatedly

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

Ahhh... good catch!

@abicky abicky deleted the abicky:use-teardown-instead-of-shutdown branch Aug 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.