summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
AgeCommit message (Collapse)Author
2024-03-28Set ASAN_OPTIONS=disable_coredump=0 for test_execopts_rlimit testKJ Tsanaktsidis
By default, ASAN sets RLIMIT_CORE to zero, "to avoid dumping a 16T+ core file" on 64 bit systems. These tests are just asserting on the expected value of RLIMIT_CORE, not actually dumping core files, so it's fine to disable that behaviour of ASAN for this test.
2024-03-27Don't clear pending interrupts in the parent process. (#10365)Samuel Williams
2024-03-01Use `File.open` and `File.write` instead of `Kernel#open`Nobuyoshi Nakada
2024-02-04Remove TestProcess#test_low_memory_startupYusuke Endoh
It is too flaky on many platforms. Nobody is willing to fix it. Let's just stop it.
2024-01-25Use Encoding.local_charmap instead of localeHiroshi SHIBATA
In my windows environment uses cp932 for terminal encoding.
2024-01-23Rewrite Array#each in Ruby using Primitive (#9533)Takashi Kokubun
2024-01-17Omit low-memory test on old platformsNobuyoshi Nakada
2024-01-16[Bug #20184] Test for low memoryNobuyoshi Nakada
2024-01-11Prevent a warning: ambiguous first argumentYusuke Endoh
2024-01-11Add a test for what happens with concurent calls to waitpidKJ Tsanaktsidis
Ruby 3.1 and 3.2 have a bug in their _implementation_, for which I'm backporting a fix. However, the current development branch doesn't have the issue (because the MJIT -> RJIT change refactored how waitpid worked substantially). I do however want to commit the test which verifies that waitpid works properly on master. [Fixes #19387]
2023-12-29Change test_warmup_frees_pages to check each size poolPeter Zhu
This should help in debugging the intermittent test failures on CI: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2779]: <201> expected but was <202>.
2023-11-09String#force_encoding don't clear coderange if encoding is unchangedJean Boussier
Some code out there blind calls `force_encoding` without checking what the original encoding was, which clears the coderange uselessly. If the String is big, it can be a rather costly mistake. For instance the `rack-utf8_sanitizer` gem does this on request bodies.
2023-10-27Revert "Add debug info for flaky test_warmup_frees_pages"Peter Zhu
This reverts commit db3b814cb0ff6ffe83fe0c4f66cd6ce8951c3ca7. This debugging information is no longer needed.
2023-09-22Magical wait to get rid of deadlock on macOSNobuyoshi Nakada
2023-09-14[Bug #19868] Deprecate `Process::Status#&` and `Process::Status#>>`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8392
2023-09-14[Bug #19868] Suggest other Process::Status method for `&` and `>>`Nobuyoshi Nakada
`Process::Status#&` and `Process::Status#>>` are provided only for the backward compatibility with older Ruby than 1.8 where `$?` was a `Fixnum`, and the knowledge about internals of system dependent macros is necessary to use them. Modern programs and libraries should not need these methods. Notes: Merged: https://github.com/ruby/ruby/pull/8392
2023-09-14Negative value to Process::Status method for compatibilityNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8392
2023-09-12Ensure signaled processes at opening FIFO terminatedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8421
2023-09-06Try to fix flaky test_warmup_frees_pagesPeter Zhu
This test sometimes fails with: ``` 1) Failure: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2750]: <202> expected but was <203>. ```
2023-09-04Add debug info for flaky test_warmup_frees_pagesPeter Zhu
This test sometimes fails with: ``` 1) Failure: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2751]: <0> expected but was <1>. ``` I'm not sure why, so add some debug info.
2023-09-01Try to fix flaky test for Process.warmupPeter Zhu
The test sometimes fails with: ``` 1) Failure: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2749]: <0> expected but was <1>. ``` I think there's a page with an object that needs finalization, so run GC to clear that object.
2023-09-01Fix flaky test for Process.warmupPeter Zhu
The test sometimes fails with: ``` 1) Failure: TestProcess#test_warmup_run_major_gc_and_compact [test/ruby/test_process.rb:2712]: <2> expected but was <3>. ```
2023-08-27Free all empty heap pages in Process.warmupPeter Zhu
This commit adds `free_empty_pages` which frees all empty heap pages and moves the number of pages freed to the allocatable pages counter. This is used in Process.warmup to improve performance because page invalidation from copy-on-write is slower than allocating a new page. Notes: Merged: https://github.com/ruby/ruby/pull/8257
2023-08-23Handle Array#* raising ArgumentError in testJeremy Evans
Treat ArgumentError as NoMemoryError, so it will resize the array and try again. Fixes [Bug #12500] Notes: Merged: https://github.com/ruby/ruby/pull/8270
2023-08-03Remove --disable-gems for assert_separatelyPeter Zhu
assert_separately adds --disable=gems so we don't need to add --disable-gems when calling assert_separately. Notes: Merged: https://github.com/ruby/ruby/pull/8162
2023-07-26Process.warmup: precompute strings coderangeJean Boussier
This both save time for when it will be eventually needed, and avoid mutating heap pages after a potential fork. Instrumenting some large Rails app, I've witnessed up to 58% of String instances having their coderange still unknown. Notes: Merged: https://github.com/ruby/ruby/pull/8112
2023-07-17objspace is not used in parent process [ci skip]Nobuyoshi Nakada
2023-07-17Fix up to require objspaceNobuyoshi Nakada
2023-07-17Run `Process.warmup` tests in separate processesNobuyoshi Nakada
2023-07-17Implement Process.warmupJean Boussier
[Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow. Notes: Merged: https://github.com/ruby/ruby/pull/7662
2023-05-26Remove excessive timeout on test_wait_exception for FreeBSDKJ Tsanaktsidis
This should now be fixed by the previous commit. Notes: Merged: https://github.com/ruby/ruby/pull/7864
2023-05-20Set rlimit_nproc to 64 instead of 128 on OpenBSD for spawn_too_long_path testsJeremy Evans
This significantly reduces testing time, and may allow the test to pass before timeout in CI.
2023-05-15Unskip the test skipped in #4173 (#7809)KJ Tsanaktsidis
This test was skipped 12 years ago because it was flaky on FreeBSD and OpenBSD. Since then, Ruby's SIGCHLD handling has been substantially re-written (mostly by Eric Wong @normalperson in 44fc3d08). These tests now in fact pass reliably on Ruby master on FreeBSD 13.2 and OpenBSD 7.3. I stress-tested the test_wait_and_sigchild test on my laptop by running four copies of the test in a loop on a 8-core VM; both by itself and also as part of the whole test_process.rb file. I did not see any failures. Let's unskip the test and close [#4173] out. I'll keep an eye out on Ruby CI for any flakes in this file on BSD after this gets merged, but if we don't see any I'm going to assume 44fc3d08 or related changes around that time accidently fixed this bug. It's also probably important to unskip this test so that if another attempt at removing the special SIGCHLD handling is made (like was reverted in https://github.com/ruby/ruby/pull/7517), we get signal if that breaks on FreeBSD/OpenBSD. [Fixes #4173] Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-10Prevent warning: assigned but unused variableYusuke Endoh
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4 /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid ```
2023-05-10[Bug #19597] Freeze script nameNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7709
2023-05-02Allow EPIPE when the child process has exited before interruptNobuyoshi Nakada
2023-04-30Relax timeout limit for FreeBSD again [ci skip]Nobuyoshi Nakada
2023-04-13[Feature #19590] Show the invalid clock argumentNobuyoshi Nakada
Include the failed clock argument in the error message from `Process.clock_gettime` and `Process.clock_getres`. Notes: Merged: https://github.com/ruby/ruby/pull/7687
2023-04-04Revert "Fix transient heap mode"Aaron Patterson
This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25. Revert "Implement `Process.warmup`" This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
2023-04-04Implement `Process.warmup`Jean Boussier
[Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow. Notes: Merged: https://github.com/ruby/ruby/pull/7346
2023-03-22Fixup 43d20596b8fefadc309348448352bf13615129c6Hiroshi SHIBATA
2023-03-22Relax timeout limit for FreeBSDHiroshi SHIBATA
* http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20230322T063002Z.fail.html.gz * http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20230322T063002Z.fail.html.gz
2023-03-20Cache `Process.pid`Jean Boussier
[Feature #19443] It's not uncommon for database client and similar network libraries to protect themselves from Process.fork by regularly checking Process.pid Until recently most libc would cache `getpid()` so this was a cheap check to make. However as of glibc version 2.25 the PID cache is removed and calls to `getpid()` always invoke the actual system call which significantly degrades the performance of existing applications. The reason glibc removed the cache is that some libraries were bypassing `fork(2)` by issuing system calls themselves, causing stale cache issues. That isn't a concern for Ruby as bypassing MRI's primitive for forking would render the VM unusable, so we can safely cache the PID. Notes: Merged: https://github.com/ruby/ruby/pull/7326
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2022-12-15Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams
* Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-11-27Make the timeout of test_system_sigpipe longerTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/3562236318/jobs/5983796689
2022-09-20Ignore EPERM which means already being process-leaderNobuyoshi Nakada
2022-09-19Add another test for `Process.daemon`Nobuyoshi Nakada
Check for that the daemon process is detached, that means it is not a child and not waitable. Notes: Merged: https://github.com/ruby/ruby/pull/6402
2022-01-04Use omit instead of skip: test/ruby/**/*.rbHiroshi SHIBATA
2021-12-16Use `to_s` and `puts` in testsNobuyoshi Nakada
`to_s` has the explict specification while `inspect` is often vague.