aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-07-31 00:56:45 +0900
committerGitHub <noreply@github.com>2018-07-31 00:56:45 +0900
commit159e58fc60d612c3d5bd524c9cee0e0922132478 (patch)
treead868f4421b827ae393a6d463c3b7a6de29786ab
parent59c3ed1b3f90db197000e3867f255781a02412e7 (diff)
parentd35b06e2f09683c6cf0a15b2fa9c399da7e5819d (diff)
downloadrails-159e58fc60d612c3d5bd524c9cee0e0922132478.tar.gz
rails-159e58fc60d612c3d5bd524c9cee0e0922132478.tar.bz2
rails-159e58fc60d612c3d5bd524c9cee0e0922132478.zip
Merge pull request #33471 from yahonda/follows_up_33449
cpu_time and allocations are 0 when JRuby is used
-rw-r--r--activesupport/test/log_subscriber_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/test/log_subscriber_test.rb b/activesupport/test/log_subscriber_test.rb
index 4f413b9627..7f05459493 100644
--- a/activesupport/test/log_subscriber_test.rb
+++ b/activesupport/test/log_subscriber_test.rb
@@ -80,10 +80,15 @@ class SyncLogSubscriberTest < ActiveSupport::TestCase
instrument "some_event.my_log_subscriber"
wait
event = @log_subscriber.event
+ if defined?(JRUBY_VERSION)
+ assert_equal 0, event.cpu_time
+ assert_equal 0, event.allocations
+ else
+ assert_operator event.cpu_time, :>, 0
+ assert_operator event.allocations, :>, 0
+ end
assert_operator event.duration, :>, 0
- assert_operator event.cpu_time, :>, 0
assert_operator event.idle_time, :>, 0
- assert_operator event.allocations, :>, 0
end
def test_does_not_send_the_event_if_it_doesnt_match_the_class