Project

General

Profile

Actions

Bug #14626

closed

One failing test on trunk 58fbe69a5b and OSX

Added by Benoit_Tigeot (Benoit Tigeot) almost 7 years ago. Updated about 5 years ago.

Status:
Closed
Target version:
-
[ruby-core:86262]

Description

I'm using ruby/trunk on 58fbe69a5b. When I run make test-all TESTS='rubygems/test_require.rb'

Run options: "--ruby=./miniruby -I../ruby/lib -I. -I.ext/common  ../ruby/tool/runruby.rb --extout=.ext  -- --disable-gems" --excludes-dir=../ruby/test/excludes --name=!/memory_leak/

# Running tests:

[ 2/21] TestGemRequire#test_dash_i_beats_gems = 0.05 s
  1) Error:
TestGemRequire#test_dash_i_beats_gems:
NameError: uninitialized constant HELLO
    /Users/bti/code/ruby/test/rubygems/test_require.rb:65:in `test_dash_i_beats_gems'

Finished tests in 0.656300s, 31.9976 tests/s, 135.6087 assertions/s.
21 tests, 89 assertions, 0 failures, 1 errors, 1 skips

Here are my current environment details:

  • osx 10.13.2
  • ruby trunk 58fbe69a5b

Is their a guide somewhere for git bisecting ruby trunk. I'm using https://github.com/ko1/rubyhackchallenge/blob/master/EN/2_mri_structure.md#assumptions and I'm not sure about the best way of doing it.

I'm running make test-all from my build folder but do I need to run ../ruby/configure .... and make install everytime I checkout a previous version? I feel dumb of asking those questions.

Thanks a lot in advance

Actions #1

Updated by Benoit_Tigeot (Benoit Tigeot) almost 7 years ago

  • Description updated (diff)

Updated by MSP-Greg (Greg L) over 6 years ago

but do I need to run

Most build systems do perform configure, make, and make install before testing.

If you want to run tests on an existing build, you can run something like the following (when in the test folder):

ruby runner.rb --show-skip -I./lib rubygems
ruby runner.rb --show-skip -I./lib rubygems/test_require.rb

Re your particular issue, it's odd, as this test is passing in many other builds, but as I recall (I'm a windows guy), MacOS uses clang(?)

Anyway, the assert immediately before your failure is requiring the file defining the HELLO constant, and it's not generating a failure. So, either a different file is being loaded (unlikely), or your build isn't parsing the file generated by the following:

File.open(c_rb, 'w') { |f| f.write "class Object; HELLO = 'world' end" }

You might try using that statement with an appropriate filename, require the file, and see if the constant exists. Then again, I keep thinking something is really strange, or, I'm missing something. There have been changes that involve parsing, maybe the string needs a "\n" at the end? Just a wild guess...

Greg

Updated by Benoit_Tigeot (Benoit Tigeot) over 6 years ago

Thanks a lot for the help.

Localy I have this setup https://github.com/ko1/rubyhackchallenge/blob/master/EN/2_mri_structure.md#assumptions


    code/
        ruby/ <- git cloned directory
        build/ <- build directory (*.o files and other compilation artifacts are stored here)
        install/ <- install directory (workdir/install/bin/ruby is the installed binary)

The naive command I run is
cd ~/code/ruby && autoconf && cd ~/code/build && ../ruby/configure --prefix=$PWD/../install --enable-shared --with-openssl-dir="$(brew --prefix openssl)" --with-readline-dir="$(brew --prefix readline)" --disable-libedit && make -j && make install-nodoc && clear; make test-all TESTS='rubygems/test_require.rb'

The failing test appears between ruby version v2_2_9 and v2_3_0 when this tests was introduced. I will stop bisecting and instead ask rubygems team. :)

https://github.com/rubygems/rubygems/issues/2251

Updated by hsbt (Hiroshi SHIBATA) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

I couldn't reproduce with make -C build_dir test-all TESTS="rubygems/test_require.rb"

~/D/g/r/ruby (trunk) > mk test-all TESTS="rubygems/test_require.rb"
make: Entering directory '/Users/hsbt/Documents/github.com/ruby/ruby/.x86_64-darwin'
Run options: "--ruby=./miniruby -I../lib -I. -I.ext/common  ../tool/runruby.rb --extout=.ext  -- --disable-gems" --excludes-dir=../test/excludes --name=!/memory_leak/

# Running tests:

Finished tests in 0.784839s, 26.7571 tests/s, 114.6732 assertions/s.                 
21 tests, 90 assertions, 0 failures, 0 errors, 1 skips

ruby -v: ruby 2.6.0dev (2018-03-26 trunk 62923) [x86_64-darwin17]
make: Leaving directory '/Users/hsbt/Documents/github.com/ruby/ruby/.x86_64-darwin'

Updated by MSP-Greg (Greg L) over 6 years ago

Benoit_Tigeot (Benoit Tigeot) wrote:

The failing test appears between ruby version v2_2_9 and v2_3_0 when this tests was introduced.

Thanks for rechecking. On Windows, using ruby 2.3.7p407 (2018-02-01 revision 62148) [x64-mingw32], I ran the file using the current trunk test suite (commented out MJIT statements), and the test passed.

I will stop bisecting and instead ask rubygems team. :)

Re my previous post, part of what I was trying to point out is that a failed test may not necessarily show a bug in the code it was designed to test. It may, sometimes just by chance, show a bug in methods unrelated to the test's purpose.

Regardless, since I can't repo, I can't help any further. Hopefully, someone else can repo it or you can provide more information clarifying the cause.

Greg

Actions #7

Updated by jeremyevans0 (Jeremy Evans) about 5 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0