Project

General

Profile

Actions

Bug #18002

open

s390x: Tests failing without LC_ALL env

Added by jaruga (Jun Aruga) over 3 years ago. Updated 8 months ago.

Status:
Assigned
Target version:
-
[ruby-core:104376]

Description

The following failures happened in RubyCI on our s390x Ubuntu focal server.
On the server, RubyCI (ruby/chkbuild) is executed with LC_ALL not set, by cron.
I found the unset LC_ALL causes the failures on the s390x server. This does not happen on x86_64 Fedora 33 on my local machine.

I was able to reproduce the failures on the master branch dbd1887d04f5ff7c2a1f0a27d7339133a on the server.

Reproducer

$ uname -m
s390x

$ autoconf

$ ./configure \
  --prefix=${HOME}/local/ruby-master-9d96837 \
  --enable-shared

$ make

Without LC_ALL

Then run the tests without LC_ALL.

$ unset LC_ALL

$ echo $LC_ALL
  <= empty
$ make test-all TESTS="-v test/ruby/test_file.rb -n TestFile#test_realpath_encoding"
Run options:-
  --seed=85060
  "--ruby=./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems"
  --excludes-dir=./test/excludes
  --name=!/memory_leak/
  -v
  -n
  TestFile#test_realpath_encoding

# Running tests:

[1/0] TestFile#test_realpath_encoding = 0.00 s

  1) Failure:
TestFile#test_realpath_encoding [/home/jaruga/git/ruby/ruby2/test/ruby/test_file.rb:284]:
<"/tmp/rubytest-realpath20210621-3365652-za1wql/A\u0391\u0410\u0531\u10A0\u05D0\u2C00\u3042"> expected but was
<"/tmp/rubytest-realpath20210621-3365652-za1wql/A\u00CE\u0091\u00D0\u0090\u00D4\u00B1\u00E1\u0082\u00A0\u00D7\u0090\u00E2\u00B0\u0080\u00E3\u0081\u0082">.

Finished tests in 0.007217s, 138.5674 tests/s, 692.8372 assertions/s.
1 tests, 5 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
make: *** [uncommon.mk:803: yes-test-all] Error 1
$ make test-all TESTS="-v test/irb/test_context.rb -n TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception"
Run options:-
  --seed=74635
  "--ruby=./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems"
  --excludes-dir=./test/excludes
  --name=!/memory_leak/
  -v
  -n
  TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception

# Running tests:

[1/0] TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception = 0.00 s

  1) Failure:
TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception [/home/jaruga/git/ruby/ruby2/test/irb/test_context.rb:505]:
Expected /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/
to match
  "(irb):1:in `fuga': A�B (RuntimeError)\n"+
  "\tfrom (irb):1:in `hoge'\n"+
  "\tfrom (irb):1:in `<main>'\n"
after 1 patterns with 0 characters.

Finished tests in 0.007640s, 130.8819 tests/s, 785.2916 assertions/s.
1 tests, 6 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
make: *** [uncommon.mk:803: yes-test-all] Error 1

With export LC_ALL=C

On the export LC_ALL=C (LC_ALL=C without export is not enough to pass the tests)

$ export LC_ALL=C

$ echo $LC_ALL
C
$ make test-all TESTS="-v test/ruby/test_file.rb -n TestFile#test_realpath_encoding"
Run options: 
  --seed=89696
  "--ruby=./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems"
  --excludes-dir=./test/excludes
  --name=!/memory_leak/
  -v
  -n
  TestFile#test_realpath_encoding

# Running tests:

[1/0] TestFile#test_realpath_encoding = 0.00 s
Finished tests in 0.004715s, 212.0691 tests/s, 1060.3455 assertions/s.
1 tests, 5 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
$ make test-all TESTS="-v test/irb/test_context.rb -n TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception"
Run options: 
  --seed=67965
  "--ruby=./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems"
  --excludes-dir=./test/excludes
  --name=!/memory_leak/
  -v
  -n
  TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception

# Running tests:

[1/0] TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception = 0.00 s
Finished tests in 0.007877s, 126.9448 tests/s, 761.6689 assertions/s.
1 tests, 6 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]

Possible Solution

Fix the tests not depending on the external LC_ALL condition.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0