summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-05-23[ruby/fiddle] Fix assignment to array within struct (#26)sinisterchipmunk
* Allow access to a struct's underlying memory with `struct[offset, length]`. https://github.com/ruby/fiddle/commit/24083690a6 Notes: Merged: https://github.com/ruby/ruby/pull/3068
2020-05-23[ruby/fiddle] Make array access override compatible with base class (#25)sinisterchipmunk
* Allow access to a struct's underlying memory with `struct[offset, length]`. * Make accessing a struct's underlying memory more convenient. * refactor memory access unit tests for improved clarity https://github.com/ruby/fiddle/commit/c082c81bb5 Notes: Merged: https://github.com/ruby/ruby/pull/3068
2020-05-22Fix origin iclass pointer for modulesJeremy Evans
If a module has an origin, and that module is included in another module or class, previously the iclass created for the module had an origin pointer to the module's origin instead of the iclass's origin. Setting the origin pointer correctly requires using a stack, since the origin iclass is not created until after the iclass itself. Use a hidden ruby array to implement that stack. Correctly assigning the origin pointers in the iclass caused a use-after-free in GC. If a module with an origin is included in a class, the iclass shares a method table with the module and the iclass origin shares a method table with module origin. Mark iclass origin with a flag that notes that even though the iclass is an origin, it shares a method table, so the method table should not be garbage collected. The shared method table will be garbage collected when the module origin is garbage collected. I've tested that this does not introduce a memory leak. This change caused a VM assertion failure, which was traced to callable method entries using the incorrect defined_class. Update rb_vm_check_redefinition_opt_method and find_defined_class_by_owner to treat iclass origins different than class origins to avoid this issue. This also includes a fix for Module#included_modules to skip iclasses with origins. Fixes [Bug #16736] Notes: Merged: https://github.com/ruby/ruby/pull/3136
2020-05-22Revert "Fix origin iclass pointer for modules"Jeremy Evans
This reverts commit c745a60634260ba2080d35af6fdeaaae86fe5193. This triggers a VM assertion. Reverting until the issue can be debugged.
2020-05-22Fix origin iclass pointer for modulesJeremy Evans
If a module has an origin, and that module is included in another module or class, previously the iclass created for the module had an origin pointer to the module's origin instead of the iclass's origin. Setting the origin pointer correctly requires using a stack, since the origin iclass is not created until after the iclass itself. Use a hidden ruby array to implement that stack. Correctly assigning the origin pointers in the iclass caused a use-after-free in GC. If a module with an origin is included in a class, the iclass shares a method table with the module and the iclass origin shares a method table with module origin. Mark iclass origin with a flag that notes that even though the iclass is an origin, it shares a method table, so the method table should not be garbage collected. The shared method table will be garbage collected when the module origin is garbage collected. I've tested that this does not introduce a memory leak. This also includes a fix for Module#included_modules to skip iclasses with origins. Fixes [Bug #16736] Notes: Merged: https://github.com/ruby/ruby/pull/2978
2020-05-22Run major GC three times to make sure the minor GC reasonYusuke Endoh
Same as 02705b27be207fce57bd0253251f81108c7ed57b http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/2955433 ``` 1) TestGc#test_start_full_mark [/tmp/ruby/v3/src/trunk-random1/test/ruby/test_gc.rb:61]: Expected :oldmalloc to be nil. ```
2020-05-21test/ruby/test_optimization.rb: Proc creation test should count :T_DATAYusuke Endoh
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-17[ruby/reline] Add a test of autowrap for yamatanoorotiaycabta
https://github.com/ruby/reline/commit/38676ba8c2
2020-05-17Removed useless implementation testsNobuyoshi Nakada
2020-05-17Removed PRNG implementation details from the testNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3116
2020-05-15Fixed argument forwarding in reserved word method [Bug #16854]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3112
2020-05-15fix for multi-run test.Koichi Sasada
TestAutoload#test_source_location can't run multiple test-run so that use assert_separately(). repro command: make yes-test-all TESTS='--repeat-count=50 ruby/test_autoload -n test_source_location' Notes: Merged: https://github.com/ruby/ruby/pull/3111
2020-05-15Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3110
2020-05-15test/scheduler: suppress warningsYusuke Endoh
https://rubyci.s3.amazonaws.com/debian/ruby-master/log/20200514T123004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:29: warning: assigned but unused variable - fiber /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:156: warning: method redefined; discarding old fiber /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/test_fiber.rb:27: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
2020-05-14Endless method definition including `rescue` modifierNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3108
2020-05-14Removed trailing spaces [ci skip]Nobuyoshi Nakada
2020-05-14Thread scheduler for light weight concurrency.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3032 Merged-By: ioquatix <samuel@codeotaku.com>
2020-05-14Restore class variable setting for testsaycabta
2020-05-14Initialize Reline callbacks when test suit startsaycabta
2020-05-14Delete inner text buffer after testsaycabta
2020-05-14Restore Readline.completion_case_fold in testaycabta
2020-05-13[ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_fileKazuki Yamaguchi
Let's revert the changes for now, as it cannot be included in the 2.2.0 release. My comment on #257: > A blocker is OpenSSL::SSL::SSLContext#add_certificate_chain_file. It > has a pending change and I don't want to include it in an incomplete > state. > > The initial implementation in commit 46e4bdba40c5 was not really > useful. The issue is described in #305. #309 extended it > to take the corresponding private key together. However, the new > implementation was incompatible on Windows and was reverted by #320 to > the initial one. > > (The prerequisite to implement it in) an alternative way is #288, and > it's still cooking. This effectively reverts the following commits: - dacd08937ccd ("ssl: suppress test failure with SSLContext#add_certificate_chain_file", 2020-03-09) - 46e4bdba40c5 ("Add support for SSL_CTX_use_certificate_chain_file. Fixes #254.", 2019-06-13) https://github.com/ruby/openssl/commit/ea925619a9
2020-05-13[ruby/openssl] pkey: add PKey#inspect and #oidKazuki Yamaguchi
Implement OpenSSL::PKey::PKey#oid as a wrapper around EVP_PKEY_id(). This allows user code to check the type of a PKey object. EVP_PKEY can have a pkey type for which we do not provide a dedicated subclass. In other words, an EVP_PKEY that is not any of {RSA,DSA,DH,EC} can exist. It is currently not possible to distinguish such a pkey. Also, implement PKey#inspect to include the key type for convenience. https://github.com/ruby/openssl/commit/dafbb1b3e6
2020-05-13[ruby/openssl] Look up cipher by name instead of constantBart de Water
https://github.com/ruby/openssl/commit/b08ae7e73d
2020-05-13[ruby/openssl] Look up digest by name instead of constantBart de Water
https://github.com/ruby/openssl/commit/b28fb2f05c
2020-05-13[ruby/openssl] Add Marshal support to PKey objectsBart de Water
https://github.com/ruby/openssl/commit/c4374ff041
2020-05-12test/lib/jit_support.rb: Let JIT tests skip on centos8Yusuke Endoh
It has the same issue as RHEL 8. k0kubun said he will fix later
2020-05-12Revert "Sync did_you_mean"Nobuyoshi Nakada
This reverts commit 946dadd3f479198e87873a863d15c7660a8e2b56, which broke `TestGemRequire` and others.
2020-05-11Sync did_you_meanYuki Nishijima
2020-05-12Also use pipe for input in testaycabta
2020-05-12numeric.c: optimize `float ** 2` case by fastpathYusuke Endoh
It would be a relatively frequent case. It is still slower than `float * float` because `*` has a dedicated VM instruction (opt_mult), though.
2020-05-11Remove the 65 size limit for name_err_mesg_to_strJean Boussier
This limit was introduced on Nov 20 1996 in 554b989ba1623b9f6a0b76f00824c83a23fbcbc1 Apparently to protect from a buffer overflow: * eval.c (f_missing): オブジェクトの文字列表現が長すぎる時バッファ を書き潰していた However I tested that path with very large strings and it works fine. Notes: Merged: https://github.com/ruby/ruby/pull/3090
2020-05-10Run rb_syswait on exec failureTakashi Kokubun
not only when !w but also when w == WAITPID_LOCK_ONLY. See also: f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 and a2264342063260d660b99872eaf5080f6ab08e81. We thought this change was an oversight in the latter commit. Without this change, the test fails like: $ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit" ... 1) Failure: TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]: Expected [[26799, #<Process::Status: pid 26799 exit 127>]] to be empty. Co-Authored-By: Yusuke Endoh <mame@ruby-lang.org>
2020-05-09Workaround a zombie process created by Open3Takashi Kokubun
with MJIT worker enabled The problem: ``` $ ruby -ropen3 --jit -e 'Open3.capture2e("cmake") rescue nil;binding.irb' irb(main)[01:0]> Process.waitall => [[10656, #<Process::Status: pid 10656 exit 127>]] $ ruby -ropen3 -e 'Open3.capture2e("cmake") rescue nil;binding.irb' irb(main)[01:0]> Process.waitall => [] ``` Not sure why it's happening yet, but first I'd like to prevent trunk-mjit-wait from failing like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2929075.
2020-05-10test/rubygems/test_gem_ext_cmake_builder.rb: make sure cmake availableYusuke Endoh
just for a case. In addition, this change suppresses unused variable warning.
2020-05-09Use %w instead of %i not to create unused IDsNobuyoshi Nakada
2020-05-09test/io/console/test_io_console.rb: Rescue Errno::ENXIO for SolarisYusuke Endoh
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20200509T100003Z.fail.html.gz ``` 1) Failure: TestIO_Console#test_failed_path [/export/home/users/chkbuild/cb-gcc/tmp/build/20200509T100003Z/ruby/test/io/console/test_io_console.rb:40]: [Errno::ENODEV, Errno::ENOTTY, Errno::EBADF] exception expected, not #<Errno::ENXIO: No such device or address - /dev/null>. ```
2020-05-09[ruby/io-console] Fails with EBADF on mingwNobuyoshi Nakada
https://github.com/ruby/io-console/commit/530cec574c
2020-05-09[ruby/io-console] Expanded expected errorsNobuyoshi Nakada
May fail with ENOTTY instead of ENODEV. https://github.com/ruby/io-console/commit/fe117b89e0
2020-05-09Fix typosKazuhiro NISHIYAMA
2020-05-09[ruby/io-console] Added test for failed pathNobuyoshi Nakada
https://github.com/ruby/io-console/commit/06a540f9b4
2020-05-08Classes made from Struct should have default `new` singleton method.Marc-Andre Lafortune
[Bug #16465] [Bug #16801] [Fix GH-2795] [Fix GH-2944] [Fix GH-3045] [Fix GH-3093] Note: Backporting shouldn't modify object.h and instead can use struct_new_kw which is basically a duplicate implementation of rb_class_new_instance_pass_kw Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: Adam Hess <HParker@github.com> Co-authored-by: Jose Cortinas <jacortinas@gmail.com> Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/3093
2020-05-08`Open3.capture2e` raises exception when the command is not present.Hiroshi SHIBATA
2020-05-08Revert "[rubygems/rubygems] Remove unneeded global teardown"Hiroshi SHIBATA
This reverts commit 93d1588c782ab9d61699f98b6c64d7f0ab8121c0. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Revert "[rubygems/rubygems] Remove unneeded teardown"Hiroshi SHIBATA
This reverts commit 0da416ab170dbe1cbd530a5a7c5e8128910014b2. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded teardownDavid Rodríguez
Tests using credentials shouldn't be leaving side effects. https://github.com/rubygems/rubygems/commit/975bcafdfc Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded global teardownDavid Rodríguez
Instead, make each test cleanup after itself. https://github.com/rubygems/rubygems/commit/e0aba9d64f Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Removed needless setup to clear credentialHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/4f694f4fb7 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Also added credential_setup to the some of testsHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/2ac557d008 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Split credential helper as credential_setup and use itHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/b0c55c76ca Notes: Merged: https://github.com/ruby/ruby/pull/3092