summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-02-26Merge uri-0.12.4Hiroshi SHIBATA
2025-02-26Merge cgi-0.3.7Hiroshi SHIBATA
2025-02-15Revert "[ruby/openssl] Relax error message check for OpenSSL 3.1"Hiroshi SHIBATA
This reverts commit 2864f0696b9c1225272e3d5782b48d107a815aaa.
2025-02-14[ruby/openssl] Relax error message check for OpenSSL 3.1Nobuyoshi Nakada
A tentative measures fo https://github.com/ruby/openssl/issues/606. With OpenSSL 3.1.0, the error message at connection using "self-signed certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of `SSL_R_CERTIFICATE_VERIFY_FAILED`. https://github.com/ruby/openssl/commit/fc4629d246
2024-11-20Revert "Skip tests that suddenly started failing for MinGW"Hiroshi SHIBATA
This reverts commit 279fb0083a9c9fd4423068cb738762c7a169c9cc.
2024-11-11Removed temporary workaround for MinGWHiroshi SHIBATA
2024-11-11[ruby/net-http] test_https.rb - fix test_session_reuse_but_expireMSP-Greg
https://github.com/ruby/net-http/commit/5544243c41
2024-11-11[ruby/openssl] Only CSR version 1 (encoded as 0) is allowed by PKIX standardsJob Snijders
RFC 2986, section 4.1 only defines version 1 for CSRs. This version is encoded as a 0. Starting with OpenSSL 3.3, setting the CSR version to anything but 1 fails. Do not attempt to generate a CSR with invalid version (which now fails) and invalidate the CSR in test_sign_and_verify_rsa_sha1 by changing its subject rather than using an invalid version. This commit fixes the following error. ``` 2) Error: test_version(OpenSSL::TestX509Request): OpenSSL::X509::RequestError: X509_REQ_set_version: passed invalid argument /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:18:in `version=' /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:18:in `issue_csr' /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:43:in `test_version' 40: req = OpenSSL::X509::Request.new(req.to_der) 41: assert_equal(0, req.version) 42: => 43: req = issue_csr(1, @dn, @rsa1024, OpenSSL::Digest.new('SHA256')) 44: assert_equal(1, req.version) 45: req = OpenSSL::X509::Request.new(req.to_der) 46: assert_equal(1, req.version) ``` https://github.com/ruby/openssl/commit/c06fdeb091
2024-11-06OpenSSL::TestX509Request#test_sign_and_verify_rsa_sha1 is also not working ↵Hiroshi SHIBATA
with MinGW
2024-11-06Skip tests that suddenly started failing for MinGWTakashi Kokubun
These test failures first appeared on irrelevant changes. It probably came from changes in GitHub Actions instead of CRuby's. Until we figure out how to fix these tests, let's skip them to make the CI usable.
2024-11-06Pend some tests because these are not working with macOS 15 and Xcode 16Hiroshi SHIBATA
2024-05-17[ruby/openssl] test_asn1.rb: Remove the assertions of the time string format ↵Jun Aruga
without second. This commit fixes the following errors in the tests. Because the OpenSSL project changed the code to make the time string format without second invalid. So, we drop the assertions. ``` 1) Error: test_generalizedtime(OpenSSL::TestASN1): OpenSSL::ASN1::ASN1Error: generalizedtime is too short /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode' /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode_test' /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:433:in `test_generalizedtime' 430: OpenSSL::ASN1::GeneralizedTime.new(Time.utc(9999, 9, 8, 23, 43, 39)) 431: # LibreSSL 3.6.0 requires the seconds element 432: return if libressl? => 433: decode_test B(%w{ 18 0D }) + "201612081934Z".b, 434: OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 0)) 435: # not implemented 436: # decode_test B(%w{ 18 13 }) + "https://github.com/ruby/openssl/commit/201612081934+0930".b, 2) Error: test_utctime(OpenSSL::TestASN1): OpenSSL::ASN1::ASN1Error: utctime is too short /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode' /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode_test' /home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:411:in `test_utctime' 408: end 409: # Seconds is omitted. LibreSSL 3.6.0 requires it 410: return if libressl? => 411: decode_test B(%w{ 17 0B }) + "1609082343Z".b, 412: OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0)) 413: # not implemented 414: # decode_test B(%w{ 17 11 }) + "https://github.com/ruby/openssl/commit/500908234339+0930".b, ``` https://github.com/ruby/openssl/commit/2e826d5715
2024-05-17[ruby/openssl] test/openssl/test_asn1.rb: skip failing tests on LibreSSL 3.6.0Kazuki Yamaguchi
LibreSSL 3.6.0 expects the seconds part in UTCTime and GeneralizedTime to be always present. LibreSSL 3.6.0 release note [1] says: > - The ASN.1 time parser has been refactored and rewritten using CBS. > It has been made stricter in that it now enforces the rules from > RFC 5280. [1] https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.0-relnotes.txt https://github.com/ruby/openssl/commit/bbc540fe83
2024-05-17[ruby/net-http] Skip test_session_reuse_but_expire with OpenSSL 3.3Xi Ruoyao
OpenSSL 3.3.0 9 Apr 2024 is also broken. Signed-off-by: Xi Ruoyao <xry111@xry111.site> https://github.com/ruby/net-http/commit/ab525c956d
2024-04-23Merge StringIO 3.0.1.2Hiroshi SHIBATA
2024-04-15merge revision(s) 64b6a018a38f200c957fdbbe7d0cbe0e64781c9f:nagachika
Fix test session reuse but expire (#9824) * OpenSSL 3.2.1 30 Jan 2024 is also broken Import 45064610725ddd81a5ea3775da35aa46985bc789 from ruby_3_3 branch tentatively. --- test/net/http/test_https.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2024-01-11Omit test_session_reuse_but_expire if OpenSSL 3.2.0Nobuyoshi Nakada
2024-01-11Omit a broken https test on MinGWTakashi Kokubun
This started to reliably fail on MinGW at an irrelevant commit: https://github.com/ruby/ruby/actions/runs/6981002841/job/18997302124 https://github.com/ruby/ruby/actions/runs/6981946473/job/19000104223 https://github.com/ruby/ruby/actions/runs/6983823136/job/19005613809 https://github.com/ruby/ruby/actions/runs/6983912116/job/19005844596 https://github.com/ruby/ruby/actions/runs/6984215921/job/19006649495 https://github.com/ruby/ruby/actions/runs/6984383103/job/19007100446 https://github.com/ruby/ruby/actions/runs/6986489509/job/19012000642 So this failure is not detecting a new bug. Let's skip this until we fix this test for MinGW.
2024-01-11[ruby/net-http] Renew test certificatesSorah Fukumori
The private key is replaced with a public known test key published at [RFC 9500]. Also lifetime has been extended to 10 years from 4 years. [RFC 9500]: https://www.rfc-editor.org/rfc/rfc9500.html https://github.com/ruby/net-http/commit/4ab6c4a500
2023-11-20merge revision(s) 9eac9d71786a8dbec520d0541a91149f01adf8ea: [Backport #19969]U.Nakamura
[Bug #19969] Compact st_table after deleted if possible --- hash.c | 19 +++++++++++++++++++ st.c | 40 +++++++++++++++++++++++++++++----------- test/ruby/test_hash.rb | 9 +++++++++ 3 files changed, 57 insertions(+), 11 deletions(-)
2023-11-10Merge RubyGems-3.3.27 and Bundler-2.3.27 (#8889)Hiroshi SHIBATA
2023-11-07Ease the `Encoding::CompatibilityError` test failureNobuyoshi Nakada
At the time this test first started using `assert_raise_with_message`, it did not touch `Encoding.default_internal`.
2023-11-06merge revision(s) 4329554f171fdb483cafa672df5f2a08741940c5: [Backport #19985]U.Nakamura
[Bug #19985] Raise LoadError with the converted feature name `Kernel#require` converts feature name objects that have the `to_path` method such as `Pathname`, but had used the original object on error and had resulted in an unexpected `TypeError`. --- load.c | 14 +++++++++++--- test/ruby/test_require.rb | 26 +++++++++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-)
2023-11-06merge revision(s) 19346c2336053b351673da030b00c704138252d8: [Backport #19754]U.Nakamura
[Bug #19754] Make `IO::Buffer#get_string` check `offset` range (#8016) --- io_buffer.c | 3 +++ test/ruby/test_io_buffer.rb | 8 ++++++++ 2 files changed, 11 insertions(+)
2023-11-06merge revision(s) 4a7d6c2852aa734506be83c932168e8f974687b5: [Backport #18991]U.Nakamura
Fix false LocalJumpError when branch coverage is enabled `throw TAG_BREAK` instruction makes a jump only if the continuation of catch of TAG_BREAK exactly matches the instruction immediately following the "send" instruction that is currently being executed. Otherwise, it seems to determine break from proc-closure. Branch coverage may insert some recording instructions after "send" instruction, which broke the conditions for TAG_BREAK to work properly. This change forces to set the continuation of catch of TAG_BREAK immediately after "send" (or "invokesuper") instruction. [Bug #18991] --- compile.c | 25 ++++++++++++++++++++++++- test/coverage/test_coverage.rb | 14 ++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-)
2023-10-17merge revision(s) 96c5a4be7b0d72502001734770af0f4a735c544c: [Backport #19894]U.Nakamura
Fix memory leak in complemented method entries [Bug #19894] When a copy of a complemented method entry is created, there are two issues: 1. IMEMO_FL_USER3 is not copied, so the complemented status is not copied over. 2. In rb_method_entry_clone we increment both alias_count and complemented_count. However, when we free the method entry in rb_method_definition_release, we only decrement one of the two counters, resulting in the rb_method_definition_t being leaked. Co-authored-by: Adam Hess <adamhess1991@gmail.com> --- method.h | 5 +++-- test/ruby/test_module.rb | 29 +++++++++++++++++++++++++++++ vm_method.c | 8 +++++--- 3 files changed, 37 insertions(+), 5 deletions(-)
2023-10-10merge revision(s) a28c5151f567cada0d2f5c0c3ec4df7f97b80784: [Backport #19855]U.Nakamura
Fix Array#bsearch when block returns a non-integer numeric value --- array.c | 4 ++-- test/ruby/test_array.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)
2023-09-05merge revision(s) 382678d4112f4afc6272244c22924d2b004274b1: [Backport #19788]U.Nakamura
[Bug #19788] Use the result of `tCOLON2` event --- parse.y | 16 ++++++++-------- test/ripper/test_parser_events.rb | 17 +++++++++++++++++ test/ripper/test_scanner_events.rb | 5 +++++ 3 files changed, 30 insertions(+), 8 deletions(-)
2023-09-05Allow waitpid(-1) to be woken if a waitpid(pid) call is pendingKJ Tsanaktsidis
If two threads are running, with one calling waitpid(-1), and another calling waitpid($some_pid), and then $some_other_pid exits, we would expect the waitpid(-1) call to retrieve that exit status; however, it cannot actually do so until $some_pid _also_ exits. This patch fixes the issue by unconditionally checking for pending process group waits on SIGCHLD, and then allowing pending pid-only waits to "steal" the notification. [Fixes #19387]
2023-07-26Revert "merge revision(s) 91c004885fc75a93cadf0094fa86ec3bd0ec25f5: ↵U.Nakamura
[Backport #19025]" This reverts commit e55dde3bdddbc595be12e7184a23e729647eb989.
2023-07-25merge revision(s) 91c004885fc75a93cadf0094fa86ec3bd0ec25f5: [Backport #19025]U.Nakamura
[Bug #19025] Numbered parameter names are always local variables --- parse.y | 2 +- test/ruby/test_syntax.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
2023-07-25merge revision(s) 09295ea796900fb7b05d29e93364090e21598566: [Backport #19543]U.Nakamura
IO::Buffer#resize: Free internal buffer if new size is zero (#7569) `#resize(0)` on an IO::Buffer with internal buffer allocated will result in calling `realloc(data->base, 0)`. The behavior of `realloc` with size = 0 is implementation-defined (glibc frees the object and returns NULL, while BSDs return an inaccessible object). And thus such usage is deprecated in standard C (upcoming C23 will make it UB). To avoid this problem, just `free`s the memory when the new size is zero. --- io_buffer.c | 5 +++++ test/ruby/test_io_buffer.rb | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)
2023-07-25Backport cvar clone bug fix for 19379 to 3.1 (#7889)Eileen M. Uchitelle
* Copy cvar table on clone When a class with a class variable is cloned we need to also copy the cvar cache table from the original table to the clone. I found this bug while working on fixing [Bug #19379]. While this does not fix that bug directly it is still a required change to fix another bug revealed by the fix in https://github.com/ruby/ruby/pull/7265 This needs to be backported to 3.2.x and 3.1.x. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> * Fix cvar caching when class is cloned The class variable cache that was added in https://github.com/ruby/ruby/pull/4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> * Add missing write barrier We were missing the write barrier for class_value to cref. This should fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052 Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> --------- Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-25String#slice! should clear the coderange when truncatingU.Nakamura
[Bug #19739] This bug was incidentally fixed in Ruby 3.2 via b0b9f72 but remains on 3.1 and older. this patch is written by byroot, https://github.com/Shopify/ruby/commit/3b351ee62d4206bb72301c2e98dcb173f1e35be7 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2023-06-29CVE-2023-36617 for Ruby 3.1 (#7996)Hiroshi SHIBATA
* Bump up v0.12.2 * Merge URI-0.10.3 for Bundler
2023-06-26merge revision(s) 2c8f287: [Backport #19532]U.Nakamura
Fix handling of 6-byte codepoints in left_adjust_char_head in CESU-8 encoding --- enc/cesu_8.c | 23 +++++++++++++++++++---- test/ruby/enc/test_cesu8.rb | 4 ++++ 2 files changed, 23 insertions(+), 4 deletions(-)
2023-06-19merge revision(s) 1cdf8ab07b24ebd16e93621957196e8b1d67f2ba: [Backport #19323]U.Nakamura
[Bug #19323] Raise `RangeError` instead of integer overflow --- bignum.c | 5 ++++- test/ruby/test_integer.rb | 18 ++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-)
2023-05-08Skip drb tests on mswin (#7789)NARUSE, Yui
* Skip TestDRbSSLAry on mswin This doesn't seem to stably work on mswin: https://github.com/ruby/ruby/actions/runs/3505363753/jobs/5871633211 For CI stability, it generally seems like a bad idea to run druby tests on Windows, given that it's pretty much unstable on MinGW as well. * Do not run drb SSL tests on Windows These tests often cause a timeout and this issue seems specific to the Windows platforms. https://github.com/ruby/ruby/actions/runs/3603761925/jobs/6072346738 --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-03-30Merge Time-0.2.2v3_1_4Hiroshi SHIBATA
2023-03-29Merge URI-0.12.1Hiroshi SHIBATA
2023-03-27merge revision(s) ↵nagachika
2f916812a9b818b432ee7c299e021ec62d4727fb,ac458f6bc3c520c9f23364c85bfb033acda907a6: Skip test_europe_lisbon on macOS until we figure out why it's failing. --- test/ruby/test_time_tz.rb | 1 + 1 file changed, 1 insertion(+) Historical timezones of Lisbon in tzdata are unstable --- test/ruby/test_time_tz.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
2023-03-26Merge URI-0.12.0Hiroshi SHIBATA
2023-03-25merge revision(s) 195e32977f181c8af9233a12cfc2c98e0f7957f6:nagachika
Skip test_udp_server on s390x RHEL 7.1 It seems like it never succeeds on this CI. --- test/socket/test_socket.rb | 4 ++++ 1 file changed, 4 insertions(+)
2023-03-25merge revision(s) ↵nagachika
548086b34e3dd125edabf5dc1e46b891fad3ea9c,3dc8cde70078ccb38f5f4b0818ad5eecded01bd5,e0cf80d666d4b5df3229f030a16d10d21323508e: [Backport #19529] ObjectSpace::WeakMap: fix compaction support [Bug #19529] `rb_gc_update_tbl_refs` can't be used on `w->obj2wmap` because it's not a `VALUE -> VALUE` table, but a `VALUE -> VALUE *` table, so we need some dedicated iterator. --- test/ruby/test_weakmap.rb | 8 ++++++++ weakmap.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) Fix crash during compaction [Bug #19529] The fix for [Bug #19529] in commit 548086b contained a bug that crashes on the following script: ``` wm = ObjectSpace::WeakMap.new obj = Object.new 100.times do wm[Object.new] = obj GC.start end GC.compact ``` --- test/ruby/test_weakmap.rb | 10 ++++++++++ weakmap.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) Fix incorrect size of WeakMap buffer In wmap_final_func, j is the number of elements + 1 (since j also includes the length at the 0th index), so we should resize the buffer to size j and the new length is j - 1. --- weakmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
2023-03-25merge revision(s) 7bd7aee02e303de27d2cddfc5ef47e612d6782cb: [Backport #18464]nagachika
Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors When a Ractor is created whilst a tracepoint for RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is because during the early setup of the Ractor, the stdio objects are created, which allocates Ruby objects, which fires the tracepoint. However, the tracepoint machinery tries to dereference the control frame (ec->cfp->pc), which isn't set up yet and so crashes with a null pointer dereference. Fix this by not firing GC tracepoints if cfp isn't yet set up. --- gc.c | 1 + test/objspace/test_ractor.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/objspace/test_ractor.rb
2023-03-25merge revision(s) 790cf4b6d0475614afb127b416e87cfa39044d67: [Backport #19115]nagachika
Fix autoload status of statically linked extensions Previously, for statically-linked extensions, we used `vm->loading_table` to delay calling the init function until the extensions are required. This caused the extensions to look like they are in the middle of being loaded even before they're required. (`rb_feature_p()` returned true with a loading path output.) Combined with autoload, queries like `defined?(CONST)` and `Module#autoload?` were confused by this and returned nil incorrectly. RubyGems uses `defined?` to detect if OpenSSL is available and failed when OpenSSL was available in builds using `--with-static-linked-ext`. Use a dedicated table for the init functions instead of adding them to the loading table. This lets us remove some logic from non-EXTSTATIC builds. [Bug #19115] --- load.c | 55 +++++++++++++++++++++++++++++++++++----------- test/ruby/test_autoload.rb | 18 +++++++++++++++ vm.c | 3 +++ vm_core.h | 9 ++++++++ 4 files changed, 72 insertions(+), 13 deletions(-)
2023-03-25merge revision(s) 2e7e153a2af1456515d43b6381e38534b069b1c2: [Backport #19242]nagachika
[Bug #19242] Prohibit circular causes to be loaded --- error.c | 4 ++++ eval.c | 4 ++++ eval_error.c | 11 +++++++++++ test/ruby/test_exception.rb | 12 ++++++++++++ 4 files changed, 31 insertions(+)
2023-03-25merge revision(s) cd5cafa4a380e2459862b6e99ff0c381362ef1be: [Backport #18827]nagachika
Respect the encoding of the source [Bug #18827] Do not override the input string encoding at the time of preparation, the source encoding is not determined from the input yet. --- parse.y | 26 ++++++++++++++++---------- test/ruby/test_ast.rb | 13 +++++++++++++ test/ruby/test_syntax.rb | 9 +++++++++ 3 files changed, 38 insertions(+), 10 deletions(-)
2023-03-25merge revision(s) c5475f42694eff35465c3332e0182c0611ca5918: [Backport #18748]nagachika
Fix Range#cover? returning true for beginless ranges of different types Previously `(2..).cover?("2"..)` was false, but `(..2).cover?(.."2")` was true. This changes it so both are false, treating beginless ranges the same as endless ranges in regards to type checks. This also adds documentation to #cover? to describe behavior with beginless and endless ranges, testing each documentation example, which is how this bug was found. Fixes [Bug #18155] --- range.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- test/ruby/test_range.rb | 29 ++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-)
2023-03-25Revert "Skip the test for [Bug #19316] for a while."nagachika
This reverts commit 82d763c94ad693a2af8086df8e0455b7de2d2ce3, and add exit: :any to assert_compile. Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>