Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.

Related: rhbz#1947938
This commit is contained in:
Vít Ondruch 2020-07-27 17:16:51 +02:00
parent 3ca326ee95
commit 8a858ea256
2 changed files with 41 additions and 5 deletions

View File

@ -0,0 +1,34 @@
From 9b42fce32bff25e0569581f76f532b9d57865aef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Mon, 27 Jul 2020 14:56:05 +0200
Subject: [PATCH] Timeout the test_bug_reporter_add witout raising error.
While timeouting the threads might be still good idea, it does not seems
the timeout impacts the TestBugReporter#test_bug_reporter_add result,
because the output of the child process has been already collected
earlier.
It seems that when the system is under heavy load, the thread might not
be sheduled to finish its processing. Even finishing the child process
might take tens of seconds and therefore the test case finish might take
a while.
---
test/-ext-/bug_reporter/test_bug_reporter.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb
index 628fcd0340..2c677cc8a7 100644
--- a/test/-ext-/bug_reporter/test_bug_reporter.rb
+++ b/test/-ext-/bug_reporter/test_bug_reporter.rb
@@ -21,7 +21,7 @@ def test_bug_reporter_add
args = ["--disable-gems", "-r-test-/bug_reporter",
"-C", tmpdir]
stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
- assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
+ assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT", timeout_error: nil)
ensure
FileUtils.rm_rf(tmpdir) if tmpdir
end
--
2.27.0

View File

@ -166,6 +166,9 @@ Patch16: rubygems-3.1.3-Improve-require.patch
Patch17: rubygems-3.1.3-Revert-Exclude-empty-suffix-from-I-require-loop.patch
# https://github.com/rubygems/rubygems/pull/3639
Patch18: rubygems-3.1.3-Fix-correctness-and-performance-regression-in-require.patch
# Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.
# https://bugs.ruby-lang.org/issues/16492
Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch
# Add support for .include directive used by OpenSSL config files.
# https://github.com/ruby/openssl/pull/216
@ -586,6 +589,7 @@ rm -rf ext/fiddle/libffi*
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch22 -p1
# Provide an example of usage of the tapset:
@ -878,11 +882,6 @@ sed \
-i test/ruby/test_rubyvm_mjit.rb
%ifarch s390x
# Skip TestBugReporter#test_bug_reporter_add test, which fails quite often
# due to segmentation fault.
# https://bugs.ruby-lang.org/issues/16492
sed -i '/^ def test_bug_reporter_add$/,/^ end$/ s/^/#/' \
test/-ext-/bug_reporter/test_bug_reporter.rb
# Increase timeout for Fiddle::TestFunction#test_nogvl_poll test, which fails
# sometimes.
sed -i '/^ def test_nogvl_poll$/,/^ end$/ s/ 180,/ 1000,/' \
@ -1308,6 +1307,9 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%changelog
* Mon Jul 27 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-133
- Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.
* Fri Jun 26 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-133
- Fix `require` behavior allowing to load libraries multiple times.
Resolves: rhbz#1842989