summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-10-28Add Thread.ignore_deadlock accessorJeremy Evans
Setting this to true disables the deadlock detector. It should only be used in cases where the deadlock could be broken via some external means, such as via a signal. Now that $SAFE is no longer used, replace the safe_level_ VM flag with ignore_deadlock for storing the setting. Fixes [Bug #13768] Notes: Merged: https://github.com/ruby/ruby/pull/3710 Merged-By: jeremyevans <code@jeremyevans.net>
2020-10-28test/ruby/test_rational.rb: Prevent "assigned but unused variable"Yusuke Endoh
2020-10-27Revert "Fixed typo"Nobuyoshi Nakada
This reverts commit 379a5ca539af0e954b1cdf63b9365ad208b9c7f3. This "typo" is intentional to test the transposition detection by did_you_mean.
2020-10-27Fixed typoHiroshi SHIBATA
2020-10-26Allow non-argument endless-def with a space instead of parenthesesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3704
2020-10-26rational.c: convert a numerator to rational before calling fdiv in ↵Kenta Murata
Kernel.Rational() (#3702) This makes `Rational(BigDecimal(1), 60) == Rational(1, 60)`. [Bug #16518] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-26Assoc pattern matching (#3703)Nobuyoshi Nakada
[Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead. Notes: Merged-By: nobu <nobu@ruby-lang.org>
2020-10-23numeric.c, range.c: prohibit zero stepKenta Murata
* numeric.c: prohibit zero step in Numeric#step * range.c: prohibit zero step in Range#step * Fix ruby-spec [Feature #15573] Notes: Merged: https://github.com/ruby/ruby/pull/3689 Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-22rational.c: try converting by to_int in Rational() (#3684)Kenta Murata
[Bug #12485] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-21test/json/json_parser_test.rb: suppress warningsYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20201021T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:227: warning: ambiguous first argument; put parentheses or a space even after `-' operator /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:228: warning: ambiguous first argument; put parentheses or a space even after `-' operator ```
2020-10-21Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)Kenta Murata
* Support ArithmeticSequence in Array#slice * Extract rb_range_component_beg_len * Use rb_range_values to check Range object * Fix ary_make_partial_step * Fix for negative step cases * range.c: Describe the role of err argument in rb_range_component_beg_len * Raise a RangeError when an arithmetic sequence refers the outside of an array [Feature #16812] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-20strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-10-20Fix an issue with generate_pretty and empty objects in the Ruby and Java ↵Chris Seaton
implementations
2020-10-20Implement a freeze: parser optionJean Boussier
If set to true all parsed objects will be immediately frozen, and strings will be deduplicated if the Ruby implementation allows it.
2020-10-20range.c: Fix an exception message in rb_range_beg_lenKenta Murata
[Bug #17271]
2020-10-19Add a Ripper.lex test of :on_embexpr_endTakashi Kokubun
This is a weird use case of Ripper.lex which I'm not sure is supposed to be maintained, so I'm adding this test so that we can easily notice such changes. If we change the behavior, this will break the behavior of hamlit.gem v1 and code like https://github.com/haml/haml/pull/1043.
2020-10-17Revert "test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_reply"Yusuke Endoh
This reverts commit de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54. Remove the debugging code that is no longer needed
2020-10-17Revert "test/rinda/test_rinda.rb: Add more debugging code"Yusuke Endoh
This reverts commit ac803ab55db50ef891e3680680620d01f28a759b. Remove debugging code that is no longer needed
2020-10-17test/rinda/test_rinda.rb: Prevent a callback Proc from being GC'edYusuke Endoh
According to the log of ac803ab55db50ef891e3680680620d01f28a759b, I found that a thread terminates silently due to "recycled object" of id2ref: ``` "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:366:in `_id2ref'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:366:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1528:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1847:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1136:in `method_missing'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/test/rinda/test_rinda.rb:652:in `block in do_reply'" ``` https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201017T033002Z.log.html.gz I believe that this unintentional thread termination has caused intermittent timeout failure of `TestRingServer#test_do_reply`. The root cause of the "recycled object" issue is a bug of `TestRingServer#test_do_reply`. It creates a callback Proc object but does not hold the reference to the object: ``` callback = DRb::DRbObject.new callback ``` The original "callback" object is GC'ed unintentionally. I could consistently reproduce this issue on my machine by adding `GC.stress = true` at the first of `_test_do_reply` method body. This change uses another local variable name, "callback_orig", to keep the original Proc object.
2020-10-16keep proc on the stack so it does not moveAaron Patterson
2020-10-17test/rinda/test_rinda.rb: Add more debugging codeYusuke Endoh
in addition to de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54
2020-10-16test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_replyYusuke Endoh
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201016T063003Z.fail.html.gz ``` 1) Error: Rinda::TestRingServer#test_do_reply: Timeout::Error: timeout /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `sleep' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `wait_for' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:659:in `_test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `block in test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:807:in `with_timeout' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `test_do_reply' ```
2020-10-16test/ruby/test_syntax.rb: avoid "warning: assigned but unused variable"Yusuke Endoh
2020-10-16Adjust sp for `if true or ...`/`if false and ...`wanabe
Notes: Merged: https://github.com/ruby/ruby/pull/3445
2020-10-16Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]wanabe
Notes: Merged: https://github.com/ruby/ruby/pull/3445
2020-10-15Check encoding name to replicateNobuyoshi Nakada
https://hackerone.com/reports/954433
2020-10-15Merge rubygems-3.2.0.rc.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3660
2020-10-14remove uneffective testKoichi Sasada
RubyVM.stat[:global_method_state] is no longer available so this test doesn't check any more. Notes: Merged: https://github.com/ruby/ruby/pull/3657
2020-10-14ruby_vm_global_method_state is no longer needed.Koichi Sasada
Now ruby_vm_global_method_state is not used so let's remove it. Notes: Merged: https://github.com/ruby/ruby/pull/3657
2020-10-13test/ruby/test_fiber.rb: Suppress "assigned but unused variable" warningsYusuke Endoh
2020-10-12relax Fiber#transfer's restrictionKoichi Sasada
Using Fiber#transfer with Fiber#resume for a same Fiber is limited (once Fiber#transfer is called for a fiber, the fiber can not be resumed more). This restriction was introduced to protect the resume/yield chain, but we realized that it is too much to protect the chain. Instead of the current restriction, we introduce some other protections. (1) can not transfer to the resuming fiber. (2) can not transfer to the yielding fiber. (3) can not resume transferred fiber. (4) can not yield from not-resumed fiber. [Bug #17221] Also at the end of a transferred fiber, it had continued on root fiber. However, if the root fiber resumed a fiber (and that fiber can resumed another fiber), this behavior also breaks the resume/yield chain. So at the end of a transferred fiber, switch to the edge of resume chain from root fiber. For example, root fiber resumed f1 and f1 resumed f2, transferred to f3 and f3 terminated, then continue from the fiber f2 (it was continued from root fiber without this patch). Notes: Merged: https://github.com/ruby/ruby/pull/3636
2020-10-12Make the test suite pass on real Android/Termux environmentYusuke Endoh
Attempting to create a hard link raises EACCES
2020-10-12bignum.c (rb_int_powm): Integer#pow(0, 1) should return 0Yusuke Endoh
... instead of 1 because it requires "modulo 1". [Bug #17257]
2020-10-12Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada
Also unwrap NODE_RIPPER to check the method name. Notes: Merged: https://github.com/ruby/ruby/pull/3649
2020-10-11[ruby/io-console] Fix timeout type error (#18)Nobuyoshi Nakada
Fixed TypeError when IO#getch timed out `rb_io_wait` returns a bit-flags Integer representing available events, or Qfalse if timed out. Also the result of `NUM2INT` is not a `VALUE`. ``` $ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)" ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32] -e:1:in `getch': no implicit conversion of false into Integer (TypeError) from -e:1:in `<main>' ``` https://github.com/ruby/io-console/commit/3bdfaf62df
2020-10-06[lib/ostruct] Fix Marshal loadingMarc-Andre Lafortune
2020-10-05Remove system method for E2E testing because depends on ruby commandaycabta
Notes: Merged: https://github.com/ruby/ruby/pull/3628
2020-10-05Show stdout and stderr when history tests failaycabta
2020-10-03Fix assert_ruby_status usage in 174ae0f5775cc7af7d197963a8f87b7d1972c268Kazuhiro NISHIYAMA
2020-10-03Remove known use-after-poison bugNobuyoshi Nakada
9eda6547812cbda23a73ba3b2620520b0de2bdd6 was fixed by b9488accf9e2cbf5f7c47b42b3eb23469f0aa58d.
2020-10-03Fix ObjectSpace.dump(obj, output: :stdout)Kazuhiro NISHIYAMA
RDoc says `ObjectSpace.dump(obj, output: :stdout) # => nil`, but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe. I think it is unintentional change. Notes: Merged: https://github.com/ruby/ruby/pull/3620
2020-10-02Ensure that the comparison succeeded [Bug #17205]Nobuyoshi Nakada
2020-10-01Refined assertions for better failure messagesNobuyoshi Nakada
2020-10-01strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-10-01Remove `Thread.scheduler` from public interface.Samuel Williams
It's implementation is equivalent to: Thread.current.scheduler unless Thread.current.blocking? Notes: Merged: https://github.com/ruby/ruby/pull/3610
2020-10-01Raise an exception if the scheduler was already closed.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3612
2020-10-01Don't call `Scheduler#close` if it doesn't exist.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3612
2020-10-01stop Ractor test in test-allKoichi Sasada
Ractor changes the interpreter's running mode so now it should not use in test-all process which running with many other tests. Test with a separating process is one idea, but I'm not sure the ruby/ostruct can use this trick.
2020-09-30[ruby/ostruct] Improved YAML serialization.Marc-Andre Lafortune
Patch adapted from Pietro Monteiro [Fixes bug#8382] Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareableMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593