Peter Zhu
cf3b62b545
Fix check_tempfile_leak in leakchecker.rb
...
The instance variable @tmpfile was removed in ddcfc9f
so check_tempfile_leak
did not work.
2024-09-05 14:03:39 -04:00
Peter Zhu
2f67610f6b
Remove dependency on Tempfile::Remover in leakchecker.rb
2024-08-20 14:29:40 -04:00
Nobuyoshi Nakada
bccdc04166
Check if Bundler::EnvironmentPreserver
is defined
...
Only `Bundler` might be defined. `EnvironmentPreserver` and its
`BUNDLER_PREFIX` would be defined together in the same file.
2023-03-31 11:11:45 +09:00
Nobuyoshi Nakada
f6adc5be94
Check if Bundler is defined
2023-03-28 17:17:51 +09:00
Peter Zhu
6d83590157
Don't report changed ENV caused by Bundler
...
Bundler's backups changes environment variables starting with
BUNDLER_ORIG_. This causes a lot of noise in tests as the leakchecker
reports them as changed.
2022-11-04 15:36:30 -04:00
Nobuyoshi Nakada
983f2688db
Hack to avoid leak checker
2022-05-25 18:48:01 +09:00
Nobuyoshi Nakada
4acc7563a1
Consider environment variable case-insensitiveness
2021-11-29 23:00:20 +09:00
Hiroshi SHIBATA
8ec187c091
Replace MiniTest::Unit to Test::Unit::Runner
2021-09-11 08:48:03 +09:00
Nobuyoshi Nakada
e724857f42
Show leaked file descriptors only, without cwd, txt, and so on
2021-06-27 21:17:58 +09:00
Nobuyoshi Nakada
9f4b7fc82e
Check warning flags only if available to run with old versions
2020-07-15 23:33:24 +09:00
Yusuke Endoh
962c302a1a
test/drb/test_drbssl.rb: skip LeakChecker as openssl keeps /dev/random
...
and /dev/urandom intentionally. OpenSSL::PKey::RSA.new opens the two
random generators and keeps the file descriptors.
93f99b681a/crypto/rand/rand_unix.c (L674)
They are detected by the LeakChecker as fd leak, but it is intentional.
20200526
T160005Z.log.html.gz
```
[ 597/20199] DRbTests::TestDRbSSLAry#test_01 = 0.29 s
Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 8 #<File::Stat dev=0x6, ino=11, mode=020666, nlink=1, uid=0, gid=0, rdev=0x109, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.751999995 +0000, mtime=2020-05-23 14:45:13.751999995 +0000, ctime=2020-05-23 14:45:13.751999995 +0000>
Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 9 #<File::Stat dev=0x6, ino=10, mode=020666, nlink=1, uid=0, gid=0, rdev=0x108, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.755999995 +0000, mtime=2020-05-23 14:45:13.755999995 +0000, ctime=2020-05-23 14:45:13.755999995 +0000>
```
2020-05-27 02:07:38 +09:00
Nobuyoshi Nakada
8c3a60df2a
leakchecker.rb: show test name
...
When multiple autoclose IO objects are leaked too.
2020-05-16 17:35:09 +09:00
Kazuhiro NISHIYAMA
22b1e824d7
Check encodings of STDIN,STDOUT,STDERR too
2020-05-08 00:12:48 +09:00
Nobuyoshi Nakada
545d2ab7d2
leakchecker.rb: try lsof
2020-05-07 02:58:28 +09:00
Nobuyoshi Nakada
de3f725978
Makes nil-safe
2020-05-06 14:09:03 +09:00
Nobuyoshi Nakada
b247ac086e
Ignore FDs kept by system library
...
`getaddrinfo` on macOS seems keeping FDs to query host names
internally.
2020-05-06 13:47:09 +09:00
Nobuyoshi Nakada
039a8ef786
leakchecker.rb: search /dev/fd too
...
It is more popular than /proc/self/fd.
2020-05-06 10:09:29 +09:00
Koichi Sasada
cf52f37cae
Narrow the check target.
...
Call GC.verify_internal_consistency only for Gem related test
on i386-solaris.
2020-03-04 11:25:43 +09:00
Yusuke Endoh
43ed4eb6d1
Limit the debug code conditon so that it runs only under i386-solaris
2020-03-03 21:00:03 +09:00
Koichi Sasada
1ad9364440
add debug code for Solaris
...
Check heap consistency after each test to debug.
20200303
T012406Z.fail.html.gz
2020-03-03 15:53:46 +09:00
Kazuhiro NISHIYAMA
729b7ce270
Add check_warning_flags to leakchecker
2019-12-27 13:06:31 +09:00
Jeremy Evans
c5c05460ac
Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
...
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.
This modifies some internal functions that took a safe level argument
to no longer take the argument.
rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.
One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd. We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Yusuke Endoh
c02de30efb
tool/lib/leakchecker.rb: show the code location that allocated leaked fd
...
by using ObjectSpace.trace_object_allocations.
`make test-all LEAK_CHECKER_TRACE_OBJECT_ALLOCATION=true` will print not
only leaked fds but also where it was created.
2019-11-12 01:47:18 +09:00
Koichi Sasada
945560008f
Revert "introduce debug check."
...
This reverts commit c3b84f2de8
.
Backtrace shows it is before running tests and debug check was
nonsense.
2019-09-30 17:59:10 +09:00
Koichi Sasada
c3b84f2de8
introduce debug check.
...
There are random failures:
> lib/rubygems/core_ext/kernel_require.rb:61:in `require':
> wrong number of arguments (given 1, expected 0) (ArgumentError)
http://ci.rvm.jp/results/trunk-jemalloc@silicon-docker/2275159
To check this failure, I added a small check code.
2019-09-30 17:23:36 +09:00
Hiroshi SHIBATA
c3c0e3f5c9
Move to tool/lib from test/lib.
2019-07-02 07:59:54 +09:00