aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* `Dir.glob` always returns an arrayNobuyoshi Nakada2020-04-011-10/+5
| | | | | It is not needed to test itself, but the element should be tested instead.
* Fix helper to not assume glibcPaul Jordan2020-04-011-3/+16
|
* Optimize exivar access on JIT-ed getivarTakashi Kokubun2020-03-302-8/+35
| | | | | | | | | | | | | | | | | | JIT support of dd723771c11. $ benchmark-driver -v --rbenv 'before;before --jit;after --jit' benchmark/mjit_exivar.yml --repeat-count=4 before: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) [x86_64-linux] before --jit: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-03-31T05:57:24Z mjit-exivar 128625baec) +JIT [x86_64-linux] Calculating ------------------------------------- before before --jit after --jit mjit_exivar 57.944M 53.579M 54.471M i/s - 200.000M times in 3.451588s 3.732772s 3.671687s Comparison: mjit_exivar before: 57944345.1 i/s after --jit: 54470876.7 i/s - 1.06x slower before --jit: 53579483.4 i/s - 1.08x slower
* [rubygems/rubygems] Revert "Remove ↵David Rodríguez2020-03-301-0/+111
| | | | | | | | | | | Gem::DependencyInstaller#find_gems_with_sources" This reverts commit 04c79d3eb9d9803d9fae78575b125b325b97206e. Final removal is postponed until next year until we find a better way to manage deprecations. https://github.com/rubygems/rubygems/commit/3e1cf918a5
* [rubygems/rubygems] Enable `Style/ExtraSpacing` and auto-correctDavid Rodríguez2020-03-3021-73/+73
| | | | https://github.com/rubygems/rubygems/commit/6fa0b1b679
* [rubygems/rubygems] Remove weird spacing from error messagesDavid Rodríguez2020-03-307-40/+40
| | | | https://github.com/rubygems/rubygems/commit/9e21fe7f58
* [rubygems/rubygems] Remove weird spacing between receiver and methodDavid Rodríguez2020-03-307-43/+43
| | | | https://github.com/rubygems/rubygems/commit/d45cd34a67
* [rubygems/rubygems] Consistently left align tokenizer test columnsDavid Rodríguez2020-03-301-118/+118
| | | | | | Makes it easier to rubocop. https://github.com/rubygems/rubygems/commit/26b31248ae
* [rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygemsDavid Rodríguez2020-03-3037-284/+284
| | | | | | So it matches the style used by bundler. https://github.com/rubygems/rubygems/commit/ab0580fd65
* Clear all trace events during teardownAlan Wu2020-03-291-0/+4
| | | | | | | | | | | Since 0c2d81dada, not all trace events are cleared during VM teardown. This causes a crash when there is a tracepoint for `RUBY_INTERNAL_EVENT_GC_EXIT` active during teardown. The commit looks like a refactoring commit so I think this change was unintentional. [Bug #16682]
* Clean up /tmp leftovers in ci.rvm.jpTakashi Kokubun2020-03-281-5/+20
|
* Set external encoding correctly for File.open('f', FILE::BINARY) on WindowsJeremy Evans2020-03-271-0/+12
| | | | | | | | | | Previously, the external encoding was only set correctly for File::BINARY if keyword arguments were provided. This copies the logic for the keyword arguments case to the no keyword arguments case. Possibly it should be refactored into a separate function. Fixes [Bug #16737]
* [ruby/reline] Suppress $/ warningsNobuyoshi Nakada2020-03-271-1/+8
| | | | https://github.com/ruby/reline/commit/f4eac8c76f
* test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeoutYusuke Endoh2020-03-271-4/+4
| | | | | | | | | | | | | | | | | | The test seems to fail sometimes due to a warning message of circular require on very slow machine. ``` 1) Failure: TestDigest::TestDigestParen#test_race_mixed [/export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/test_digest.rb:263]: assert_separately failed with error message pid 12458 exit 0 | /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: loading in progress, circular require considered harmful - /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/digest/foo.rb | from -:10:in `block (2 levels) in <main>' | from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in `const_missing' | from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in `require' | ``` https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200326T091911Z.fail.html.gz
* Added implictily require for URI::HTTPHiroshi SHIBATA2020-03-261-0/+1
|
* [ruby/uri] Add support for WebSocketsMatt Muller2020-03-261-0/+70
| | | | https://github.com/ruby/uri/commit/805a95786a
* [ruby/reline] Add a comment why rescue yamatanooroti loading error on the testaycabta2020-03-261-1/+3
| | | | https://github.com/ruby/reline/commit/2a8061daec
* [ruby/reline] Rename test suite name of yamatanooroti testaycabta2020-03-261-1/+3
| | | | https://github.com/ruby/reline/commit/b0f32f5de4
* [ruby/reline] Add yamatanooroti rendering testaycabta2020-03-261-0/+37
| | | | https://github.com/ruby/reline/commit/f092519525
* [ruby/reline] Suppress error in case INPUTRC env is emptyaycabta2020-03-261-0/+9
| | | | https://github.com/ruby/reline/commit/bce7e7562b
* [ruby/reline] Work with wrong $/ value correctlyaycabta2020-03-261-0/+9
| | | | https://github.com/ruby/reline/commit/962ebf5a1b
* [ruby/irb] Suppress crashing when EncodingError has occurred without linenoaycabta2020-03-261-0/+7
| | | | https://github.com/ruby/irb/commit/13572d8cdc
* Ignore test_getbinaryfile for --jit-waitTakashi Kokubun2020-03-251-0/+2
| | | | | | | To fix this properly, we'd need to configure timeout for the server and the client because waiting for compilation takes time. Until we figure out how to do it, let me skip this.
* Make RbConfig::CONFIG values mutable [Bug #16738]Nobuyoshi Nakada2020-03-251-0/+9
| | | | | As `RbConfig.expand` modifies the argument and involved `CONFIG` values, its values should be mutable.
* Fixed crash when argument array is modifiedNobuyoshi Nakada2020-03-251-0/+12
|
* Skip a test that attempts to remove the current directory on SolarisYusuke Endoh2020-03-241-0/+1
|
* test/rubygems: Try not only /usr/bin/env but also /bin/envYusuke Endoh2020-03-243-18/+19
| | | | | | | | | | | RubyGems chooses available one from the two: /usr/bin/env or /bin/env https://github.com/rubygems/rubygems/blob/20b0d609484df2b514954ba9ef890a7cbdd01d18/lib/rubygems/installer.rb#L38 So, it is good not to hard-code /usr/bin/env in tests. This is a retry of 65201c054a90c8e7beb8fe1e6d0006541ac33449 which was accidentally deleted by 96064e6f1ce100a37680dc8f9509f06b3350e9c8
* Sync rubygems with current master (#2889)David Rodríguez2020-03-2417-310/+289
|
* test/json/test_helper.rb: Do not add a relative path to $LOAD_PATHYusuke Endoh2020-03-242-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... because it conflicts with test/ruby/test_m17n.rb. An exception `incompatible character encodings: UTF-8 and UTF-16BE` occurs when: * a non-existence relative path is added to $LOAD_PATH, * ASCII-incompatible encoding is set to default_external, and * some file is loaded. ``` $LOAD_PATH << "no_existing_dir" Encoding.default_external = Encoding::UTF_16BE load "dummy.rb" #=> incompatible character encodings: UTF-8 and UTF-16BE ``` This issue can be actually observed by a combination of out-of-place build and the following command: make test-all TESTS="json ruby/m17n -n test_object_inspect_external" http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411 ASCII-incompatible default external encoding assumes that the cwd is the encoding, and it is attempted to beconcatenated with a non-existence relative LOAD_PATH UTF-8 string, which causes the exception. This changeset avoids a relative path.
* test/ruby/test_m17n.rb: Update the debugging code to get C stacktraceYusuke Endoh2020-03-231-22/+3
|
* test/ruby/test_m17n.rb: Make the debugging code print to stderrYusuke Endoh2020-03-231-15/+15
| | | | The test is executed with -j8, so printing someting to stdout may break.
* Merge pull request #2721 from jeremyevans/method-inspect-chain-alias-11188Jeremy Evans2020-03-222-1/+27
| | | Correctly show defined class for aliases of aliases
* Support obj.clone(freeze: true) for freezing cloneJeremy Evans2020-03-221-0/+12
| | | | | | | | | | | | | | | | | | This freezes the clone even if the receiver is not frozen. It is only for consistency with freeze: false not freezing the clone even if the receiver is frozen. Because Object#clone is now partially implemented in Ruby and not fully implemented in C, freeze: nil must be supported to provide the default behavior of only freezing the clone if the receiver is frozen. This requires modifying delegate and set, to set freeze: nil instead of freeze: true as the keyword parameter for initialize_clone. Those are the two libraries in stdlib that override initialize_clone. Implements [Feature #16175]
* test/ruby/test_m17n.rb: Add a temporal code for debuggingYusuke Endoh2020-03-221-0/+30
| | | | | | | | | http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411 ``` I, [2020-03-22T22:15:50.761950 #23076] INFO -- : 1) Error: I, [2020-03-22T22:15:50.761963 #23076] INFO -- : TestM17N#test_object_inspect_external: I, [2020-03-22T22:15:50.761974 #23076] INFO -- : Encoding::CompatibilityError: incompatible character encodings: UTF-8 and UTF-16BE ```
* test/ruby/test_fiber.rb (test_many_fibers_with_threads): relax timeoutYusuke Endoh2020-03-221-1/+1
| | | | | | | | | | | | This test takes 40..50 seconds under Solaris 11, so the timeout (60 seconds) was too strict. This change increases it to 180 seconds. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200322T100007Z.fail.html.gz ``` 1) Error: TestFiber#test_many_fibers_with_threads: Timeout::Error: execution of assert_normal_exit expired timeout (60 sec) ```
* test/net/http/test_http.rb: relax open_timeout limitYusuke Endoh2020-03-211-1/+1
| | | | | | | | | | | | | | | The test fails randomly on the CI of OpenCSW SPARC Solaris 10: https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200321T091909Z.fail.html.gz ``` 1) Failure: TestNetHTTP_v1_2_chunked#test_timeout_during_HTTP_session [/export/home/rubyci/unstable10s/tmp/build/20200321T091909Z/ruby/test/net/http/test_http.rb:575]: [Net::ReadTimeout] exception expected, not #<Net::OpenTimeout: execution expired>. ``` The environment uses RUBY_TEST_SUBPROCESS_TIMEOUT_SCALE=20, so the open timeout 0.1 sec. means 2.0 sec. for the environment, but it seems too strict because the environment is painfully slow.
* test/openssl/test_ssl.rb: ignore SSLError when the connection is closedYusuke Endoh2020-03-211-1/+6
| | | | | | | | | | | | | | | | | | "test_close_after_socket_close" checks if ssl.close is no-op even after the wrapped socket is closed. The test itself is fair, but the other endpoint that is reading the SSL connection may fail with SSLError: "SSL_read: unexpected eof while reading" in some environments: https://github.com/ruby/ruby/actions/runs/60085389 (MinGW) https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200321T034442Z.fail.html.gz ``` 1) Failure: OpenSSL::TestSSL#test_close_after_socket_close [D:/a/ruby/ruby/src/test/openssl/utils.rb:299]: exceptions on 1 threads: SSL_read: unexpected eof while reading ``` This changeset rescues and ignores the SSLError in the test.
* Ignore TestJITDebug in mswin RubyCI for nowTakashi Kokubun2020-03-181-0/+1
| | | | | It's still pending to be implemented. To be enabled later when it's implemented.
* Reduce allocations for keyword argument hashesJeremy Evans2020-03-171-0/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, passing a keyword splat to a method always allocated a hash on the caller side, and accepting arbitrary keywords in a method allocated a separate hash on the callee side. Passing explicit keywords to a method that accepted a keyword splat did not allocate a hash on the caller side, but resulted in two hashes allocated on the callee side. This commit makes passing a single keyword splat to a method not allocate a hash on the caller side. Passing multiple keyword splats or a mix of explicit keywords and a keyword splat still generates a hash on the caller side. On the callee side, if arbitrary keywords are not accepted, it does not allocate a hash. If arbitrary keywords are accepted, it will allocate a hash, but this commit uses a callinfo flag to indicate whether the caller already allocated a hash, and if so, the callee can use the passed hash without duplicating it. So this commit should make it so that a maximum of a single hash is allocated during method calls. To set the callinfo flag appropriately, method call argument compilation checks if only a single keyword splat is given. If only one keyword splat is given, the VM_CALL_KW_SPLAT_MUT callinfo flag is not set, since in that case the keyword splat is passed directly and not mutable. If more than one splat is used, a new hash needs to be generated on the caller side, and in that case the callinfo flag is set, indicating the keyword splat is mutable by the callee. In compile_hash, used for both hash and keyword argument compilation, if compiling keyword arguments and only a single keyword splat is used, pass the argument directly. On the caller side, in vm_args.c, the callinfo flag needs to be recognized and handled. Because the keyword splat argument may not be a hash, it needs to be converted to a hash first if not. Then, unless the callinfo flag is set, the hash needs to be duplicated. The temporary copy of the callinfo flag, kw_flag, is updated if a hash was duplicated, to prevent the need to duplicate it again. If we are converting to a hash or duplicating a hash, we need to update the argument array, which can including duplicating the positional splat array if one was passed. CALLER_SETUP_ARG and a couple other places needs to be modified to handle similar issues for other types of calls. This includes fairly comprehensive tests for different ways keywords are handled internally, checking that you get equal results but that keyword splats on the caller side result in distinct objects for keyword rest parameters. Included are benchmarks for keyword argument calls. Brief results when compiled without optimization: def kw(a: 1) a end def kws(**kw) kw end h = {a: 1} kw(a: 1) # about same kw(**h) # 2.37x faster kws(a: 1) # 1.30x faster kws(**h) # 2.19x faster kw(a: 1, **h) # 1.03x slower kw(**h, **h) # about same kws(a: 1, **h) # 1.16x faster kws(**h, **h) # 1.14x faster
* Make {**{}} return unfrozen empty hashJeremy Evans2020-03-171-0/+11
| | | | | | | | | | | | | | | | Previously, method call keyword splats and hash keyword splats were compiled exactly the same. This is because parse-wise, they operate on indentical nodes when it comes to compiling the **{}. Fix this by using an ugly hack of temporarily modifying the nd_brace flag in the method call keyword splat case. Inside compile_hash, only optimize the **{} case for hashes where the nd_brace flag has been modified to reflect we are in the method call keyword splat case and it is safe to do so. Since compile_keyword_args is only called in one place, move the keyword_node_p call out of that method to the single caller to avoid duplicating the code.
* `Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]Yusuke Endoh2020-03-161-0/+2
| | | | Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
* hash.c: Do not use the fast path (rb_yield_values) for lambda blocksYusuke Endoh2020-03-161-0/+6
| | | | | | | | | | | | | | | | | As a semantics, Hash#each yields a 2-element array (pairs of keys and values). So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception due to lambda's arity check. However, the optimization that avoids Array allocation by using rb_yield_values for blocks whose arity is more than 1 (introduced at b9d29603375d17c3d1d609d9662f50beaec61fa1 and some commits), seemed to overlook the lambda case, and wrongly allowed the code above to work. This change experimentally attempts to make it strict; now the code above raises an ArgumentError. This is an incompatible change; if the compatibility issue is bigger than our expectation, it may be reverted (until Ruby 3.0 release). [Bug #12706]
* [ruby/stringio] StringIO#initialize default to the source string encodingJean Boussier2020-03-151-0/+12
| | | | | | [Bug #16497] https://github.com/ruby/stringio/commit/4958a5ccab
* Resurrect test_jit_debug.rbTakashi Kokubun2020-03-141-0/+13
| | | | | | | | Revert "Temporarily drop test_jit_debug.rb" This reverts commit 5437d7c879585fbdb0c294298eb76cc563e01c69. Skipped some CIs which were failing previously.
* Skip test_abort_tls with --jit-wait for nowTakashi Kokubun2020-03-121-0/+2
| | | | | Perhaps the server blocks for an unexpectedly long time by waiting for JIT. As it's usually passing, I don't think it's detecting a bug.
* Update some syslog tests to absurb the format change of FreeBSD syslogYusuke Endoh2020-03-121-3/+4
| | | | | | | | | | | | | | | | | | FreeBSD ``` $ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }' rubyspec 78462 - - Hello ``` Linux ``` $ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }' rubyspec: Hello ``` https://github.com/freebsd/freebsd/commit/591ef7c8076109cff3c41f9bb50da996a34121e9
* Let Net::HTTP.get take request headers (#2957)Takashi Kokubun2020-03-102-1/+26
| | | | | | | | | | | * Let Net::HTTP.get take request headers * Add more test cases for no header usages * Add examples with request headers * Add a NEWS entry [ci skip] [Feature #16686]
* fix bug on method cache invalidation.Koichi Sasada2020-03-111-0/+46
| | | | | | | | To invalidate cached method entry, existing method entry (ment) is marked as invalidated and replace with copied ment. However, complemented method entry (method entries in Module) should not be set to Module's m_tbl. [Bug #16669]
* openssl: sync with upstream repositoryKazuki Yamaguchi2020-03-108-125/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import current master (2c43241dc0ed) of ruby/openssl.git. Below are the commits that were made since the last batch at commit b99775b163ce (ruby/openssl.git commit f49e7110ca1e). Note that some of them have been applied already. ---------------------------------------------------------------- Benoit Daloze (1): Remove redundant and ignored workflow file DBL-Lee (1): add support for SHA512_256/SHA512_224 Hiroshi SHIBATA (2): Guard for OpenSSL::PKey::EC::Group::Error with unsupported platforms Fixed inconsistency directory structure with ruby/ruby repo Jeremy Evans (2): Fix keyword argument separation issues in OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock Remove taint support Kazuki Yamaguchi (26): config: support .include directive random: make OpenSSL::Random.pseudo_bytes alias of .random_bytes extconf.rb: get rid of -Werror=deprecated-declarations test/openssl/test_ssl: skip test_fallback_scsv if necessary ts: simplify OpenSSL::Timestamp::Request#algorithm History.md: add missing references to GitHub issues config: deprecate OpenSSL::Config#add_value and #[]= test/openssl/test_ssl: remove sleep from test_finished_messages test/openssl/test_ssl: fix random failure in SSLSocket.open test test/openssl/test_ssl: avoid explicitly-sized private keys test/openssl/test_ssl: remove commented-out test case test/openssl/test_ssl: allow kRSA tests to fail ssl: avoid declarations after statements engine: revert OpenSSL::Engine.load changes for cloudhsm engine: remove really outdated static engines engine: do not check for ENGINE_load_builtin_engines() engine: fix guards for 'dynamic' and 'cryptodev' engines lib/openssl.rb: require openssl/version.rb x509: add error code and verify flags constants ssl: set verify error code in the case of verify_hostname failure .github/workflows: merge CI jobs into a single workflow .github/workflows: test against different OpenSSL versions .travis.yml: fully migrate to GitHub Actions ssl: suppress test failure with SSLContext#add_certificate_chain_file ssl: remove test case test_puts_meta from test_pair Revert "Use version.rb in gemspec" MSP-Greg (2): .travis.yml - remove 2.3/1.0.2, 2.5/1.1.1, head/1.0.2 Use version.rb in gemspec Samuel Williams (1): Restore compatibility with older versions of Ruby. Yusuke Endoh (1): Make OpenSSL::OSSL#test_memcmp_timing robust
* Don't display singleton class in Method#inspect unless method defined thereJeremy Evans2020-03-091-0/+8
| | | | | | | | | | | Previously, if an object has a singleton class, and you call Object#method on the object, the resulting string would include the object's singleton class, even though the method was not defined in the singleton class. Change this so the we only show the singleton class if the method is defined in the singleton class. Fixes [Bug #15608]