aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Make Thread#thread_variable? similar to #thread_variable_getJeremy Evans2020-05-251-1/+1
| | | | | | | | | | | | Don't use rb_check_id, which only works for pinned symbols. Switch inadvertent creation test for thread_variable? to only check for pinned symbols, same as thread_variable_get and thread_variable_set. Make key variable name in thread_local_set match thread_local_get and thread_variable?. Fixes [Bug #16906]
* cause SEGV for the test.Koichi Sasada2020-05-261-1/+1
| | | | | | | | | | | | | | | | 21991e6ca5 enables `__builtin_assume()` for clang and it seems skip SEGV on rb_class_of() with unexpected value. This test expects a [BUG] output, so this patch causes [BUG] to show [BUG] message. https://github.com/ruby/ruby/runs/707088232?check_suite_focus=true#step:12:230 ``` 1) Failure: TestVMDump#test_darwin_invalid_access [/Users/runner/runners/2.262.1/work/ruby/ruby/src/test/ruby/test_vm_dump.rb:19]: pid 43128 exit 0. 1. [2/2] Assertion for "stderr" | Expected /^\[IMPORTANT\]/ to match "". ```
* [ruby/rdoc] Check uninitialized instance variable in testaycabta2020-05-241-1/+1
| | | | https://github.com/ruby/rdoc/commit/3dcd5ddbb6
* [ruby/rdoc] Process crossref before tidylinkaycabta2020-05-241-0/+7
| | | | | | | The crossref must be linked before tidylink because Klass.method[:sym] will be processed as a tidylink first and will be broken. https://github.com/ruby/rdoc/commit/0f47baf6d2
* [ruby/rdoc] Escape method names in HTMLNate Matykiewicz2020-05-241-0/+14
| | | | | | | | | | | | | | | The following is invalid HTML: <a href="Array.html#method-i-3C-3C"><code><<</code></a></p> Incorrect: <code><<</code> Correct: <code>&lt;&lt;</code> Fixes #761 https://github.com/ruby/rdoc/commit/b120d087f6
* Fixup d48c92aa04ffd3a1cecef599eaa5e4409aab2fe4Hiroshi SHIBATA2020-05-231-1/+1
|
* Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA2020-05-236-6/+6
|
* [ruby/fiddle] Improve documentation on how to correctly free memory and free ↵Chris Seaton2020-05-234-47/+94
| | | | | | memory in tests (#33) https://github.com/ruby/fiddle/commit/e59cfd708a
* [ruby/fiddle] Fix assignment to array within struct (#26)sinisterchipmunk2020-05-231-0/+14
| | | | | | * Allow access to a struct's underlying memory with `struct[offset, length]`. https://github.com/ruby/fiddle/commit/24083690a6
* [ruby/fiddle] Make array access override compatible with base class (#25)sinisterchipmunk2020-05-231-0/+22
| | | | | | | | | | | * 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
* Fix origin iclass pointer for modulesJeremy Evans2020-05-221-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Revert "Fix origin iclass pointer for modules"Jeremy Evans2020-05-221-59/+0
| | | | | | | This reverts commit c745a60634260ba2080d35af6fdeaaae86fe5193. This triggers a VM assertion. Reverting until the issue can be debugged.
* Fix origin iclass pointer for modulesJeremy Evans2020-05-221-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Run major GC three times to make sure the minor GC reasonYusuke Endoh2020-05-221-1/+1
| | | | | | | | | | | 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. ```
* test/ruby/test_optimization.rb: Proc creation test should count :T_DATAYusuke Endoh2020-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [ruby/reline] Add a test of autowrap for yamatanoorotiaycabta2020-05-171-0/+10
| | | | https://github.com/ruby/reline/commit/38676ba8c2
* Removed useless implementation testsNobuyoshi Nakada2020-05-171-113/+14
|
* Removed PRNG implementation details from the testNobuyoshi Nakada2020-05-171-135/+79
|
* Fixed argument forwarding in reserved word method [Bug #16854]Nobuyoshi Nakada2020-05-151-0/+5
|
* fix for multi-run test.Koichi Sasada2020-05-151-6/+9
| | | | | | | | 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'
* Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams2020-05-158-0/+0
|
* test/scheduler: suppress warningsYusuke Endoh2020-05-152-4/+2
| | | | | | | | | | 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 ```
* Endless method definition including `rescue` modifierNobuyoshi Nakada2020-05-141-0/+6
|
* Removed trailing spaces [ci skip]Nobuyoshi Nakada2020-05-143-5/+5
|
* Thread scheduler for light weight concurrency.Samuel Williams2020-05-1411-47/+511
|
* Restore class variable setting for testsaycabta2020-05-142-0/+44
|
* Initialize Reline callbacks when test suit startsaycabta2020-05-141-0/+6
|
* Delete inner text buffer after testsaycabta2020-05-141-0/+1
|
* Restore Readline.completion_case_fold in testaycabta2020-05-141-0/+3
|
* [ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_fileKazuki Yamaguchi2020-05-131-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ruby/openssl] pkey: add PKey#inspect and #oidKazuki Yamaguchi2020-05-131-0/+28
| | | | | | | | | | | | | 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
* [ruby/openssl] Look up cipher by name instead of constantBart de Water2020-05-131-3/+3
| | | | https://github.com/ruby/openssl/commit/b08ae7e73d
* [ruby/openssl] Look up digest by name instead of constantBart de Water2020-05-1316-118/+115
| | | | https://github.com/ruby/openssl/commit/b28fb2f05c
* [ruby/openssl] Add Marshal support to PKey objectsBart de Water2020-05-134-0/+28
| | | | https://github.com/ruby/openssl/commit/c4374ff041
* test/lib/jit_support.rb: Let JIT tests skip on centos8Yusuke Endoh2020-05-121-0/+2
| | | | It has the same issue as RHEL 8. k0kubun said he will fix later
* Revert "Sync did_you_mean"Nobuyoshi Nakada2020-05-123-38/+0
| | | | | This reverts commit 946dadd3f479198e87873a863d15c7660a8e2b56, which broke `TestGemRequire` and others.
* Sync did_you_meanYuki Nishijima2020-05-113-0/+38
|
* Also use pipe for input in testaycabta2020-05-121-5/+7
|
* numeric.c: optimize `float ** 2` case by fastpathYusuke Endoh2020-05-121-0/+1
| | | | | | It would be a relatively frequent case. It is still slower than `float * float` because `*` has a dedicated VM instruction (opt_mult), though.
* Remove the 65 size limit for name_err_mesg_to_strJean Boussier2020-05-111-0/+13
| | | | | | | | | | | | | 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.
* Run rb_syswait on exec failureTakashi Kokubun2020-05-102-8/+7
| | | | | | | | | | | | | | | | 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>
* Workaround a zombie process created by Open3Takashi Kokubun2020-05-091-0/+8
| | | | | | | | | | | | | | | | | | | 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.
* test/rubygems/test_gem_ext_cmake_builder.rb: make sure cmake availableYusuke Endoh2020-05-101-0/+1
| | | | | just for a case. In addition, this change suppresses unused variable warning.
* Use %w instead of %i not to create unused IDsNobuyoshi Nakada2020-05-091-1/+1
|
* test/io/console/test_io_console.rb: Rescue Errno::ENXIO for SolarisYusuke Endoh2020-05-091-1/+1
| | | | | | | | | 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>. ```
* [ruby/io-console] Fails with EBADF on mingwNobuyoshi Nakada2020-05-091-1/+1
| | | | https://github.com/ruby/io-console/commit/530cec574c
* [ruby/io-console] Expanded expected errorsNobuyoshi Nakada2020-05-091-2/+6
| | | | | | May fail with ENOTTY instead of ENODEV. https://github.com/ruby/io-console/commit/fe117b89e0
* Fix typosKazuhiro NISHIYAMA2020-05-091-4/+4
|
* [ruby/io-console] Added test for failed pathNobuyoshi Nakada2020-05-091-0/+10
| | | | https://github.com/ruby/io-console/commit/06a540f9b4
* Classes made from Struct should have default `new` singleton method.Marc-Andre Lafortune2020-05-081-4/+14
| | | | | | | | | | | | | | | [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>