1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Yusuke Endoh 3eb3f7bb8c test/ruby/test_optimization.rb: Proc creation test should count :T_DATA
instead of :TOTAL of ObjectSpace.count_objects.

This test had failed very occasionally:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos8/ruby-master/log/20200521T033004Z.fail.html.gz
```
  1) Failure:
TestRubyOptimization#test_block_parameter_should_not_create_objects [/home/chkbuild/chkbuild/tmp/build/20200521T033004Z/ruby/test/ruby/test_optimization.rb:713]:
<0> expected but was
<407>.
```

This test of lazy proc creation checks if no object is created during a
method call.  However, calling a method itself increases the count of
objects because method cache is now an object (T_MEMO).
The reason why this test rarely fails is because the test was buggy; it
checked the count of :TOTAL, but :TOTAL count changes only when the GC
heap is expanded.  Creating one object rarely causes heap expansion.
The test must have checked not only :TOTAL but also the count of :FREE.

Instead, this change more directly checks :T_DATA.  Note that a Proc
object is T_DATA.
2020-05-21 13:27:26 +09:00
..
-ext- Fix rb_profile_frame_classpath to handle module singletons 2020-05-07 08:46:36 -07:00
base64
benchmark
bigdecimal
cgi
coverage
csv Removed trailing spaces [ci skip] 2020-05-14 19:57:39 +09:00
date
dbm
did_you_mean Revert "Sync did_you_mean" 2020-05-12 16:27:25 +09:00
digest test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeout 2020-03-27 15:32:52 +09:00
drb
dtrace
erb
etc
excludes
fiber Move test/scheduler -> test/fiber [Bug #16892][ruby-core:98366]. 2020-05-15 13:26:23 +12:00
fiddle Dir.glob always returns an array 2020-04-01 12:48:56 +09:00
fileutils
gdbm
io Use %w instead of %i not to create unused IDs 2020-05-09 20:13:30 +09:00
irb Fix typos 2020-05-09 14:22:04 +09:00
json
lib test/lib/jit_support.rb: Let JIT tests skip on centos8 2020-05-12 17:48:31 +09:00
logger
matrix [ruby/matrix] Add Matrix#adjoint [#14] 2020-05-01 03:25:15 -04:00
mkmf
monitor
net [ruby/net-ftp] Added guard condition for the old ruby versions 2020-04-08 15:51:18 +09:00
nkf
objspace
open-uri
openssl [ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_file 2020-05-13 15:47:51 +09:00
optparse
ostruct
pathname
psych
racc
rdoc Fix failures of test/rdoc/test_rdoc_ri_paths.rb 2020-04-26 16:14:14 +09:00
readline Restore class variable setting for tests 2020-05-14 12:27:33 +09:00
reline [ruby/reline] Add a test of autowrap for yamatanooroti 2020-05-17 19:26:53 +09:00
resolv
rinda
ripper Removed unnecessary RLIMIT_AS 2020-04-28 23:36:16 +09:00
ruby test/ruby/test_optimization.rb: Proc creation test should count :T_DATA 2020-05-21 13:27:26 +09:00
rubygems Run rb_syswait on exec failure 2020-05-10 00:59:55 -07:00
sdbm
socket Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
stringio
strscan
syslog
uri Fakes IPSocket.getaddress in the whole method 2020-05-06 16:06:25 +09:00
webrick
win32ole
yaml
zlib
runner.rb
test_abbrev.rb
test_delegate.rb
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_prime.rb
test_pstore.rb
test_pty.rb
test_rbconfig.rb Make RbConfig::CONFIG values mutable [Bug #16738] 2020-03-25 22:09:28 +09:00
test_securerandom.rb
test_set.rb
test_shellwords.rb
test_singleton.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb
test_win32api.rb