<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_thread_queue.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>record load average at fail</title>
<updated>2025-06-07T19:24:56+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-06-07T19:24:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0b5f3155406e8243b78e4cedd3a38710c7c323c'/>
<id>d0b5f3155406e8243b78e4cedd3a38710c7c323c</id>
<content type='text'>
On a high load machine, the following test can fail.
This patch simply records the load average with `uptime`.

```
  1) Failure:
TestThreadQueue#test_thr_kill [/tmp/ruby/src/trunk_gcc10/test/ruby/test_thread_queue.rb:239]:
only 165/250 done in 60 seconds.
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On a high load machine, the following test can fail.
This patch simply records the load average with `uptime`.

```
  1) Failure:
TestThreadQueue#test_thr_kill [/tmp/ruby/src/trunk_gcc10/test/ruby/test_thread_queue.rb:239]:
only 165/250 done in 60 seconds.
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Make {Queue,SizedQueue}#freeze raise TypeError</title>
<updated>2023-09-27T18:57:50+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-09-26T22:31:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=62181e17da2db729eb6d95f6edff9e028ff557b6'/>
<id>62181e17da2db729eb6d95f6edff9e028ff557b6</id>
<content type='text'>
Fixes [Bug #17146]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #17146]
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure producer threads do not start running early</title>
<updated>2023-05-23T00:49:53+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2023-05-19T14:11:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f890345c03dc48072167df4bce45bc506dba2a1d'/>
<id>f890345c03dc48072167df4bce45bc506dba2a1d</id>
<content type='text'>
This test caused issues occasionally on JRuby because it's
possible for a producer thread to run to completion before the
status checks begin. This results in Thread#status returning false
and the =~ call triggering a warning (3.1) or error (3.2) and
either emitting thousands of deprecation warnings or failing
outright.

The patch here introduces a mutex that remains locked until all
producer threads are seen to have started. The lock is then
released and the test proceeds. This prevents any producers from
running to completion, which in turn prevents consumers running to
completion, avoiding the warnings or error calling =~ on false.

This patch also modifies the status checks to to_s the thread
status, preventing any prematurely terminated threads from
triggering similar deprecation warnings or missing method errors
when =~ is called on nil.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This test caused issues occasionally on JRuby because it's
possible for a producer thread to run to completion before the
status checks begin. This results in Thread#status returning false
and the =~ call triggering a warning (3.1) or error (3.2) and
either emitting thousands of deprecation warnings or failing
outright.

The patch here introduces a mutex that remains locked until all
producer threads are seen to have started. The lock is then
released and the test proceeds. This prevents any producers from
running to completion, which in turn prevents consumers running to
completion, avoiding the warnings or error calling =~ on false.

This patch also modifies the status checks to to_s the thread
status, preventing any prematurely terminated threads from
triggering similar deprecation warnings or missing method errors
when =~ is called on nil.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Apply timeout-scale to test_thr_kill." (#7838)</title>
<updated>2023-05-22T12:53:05+00:00</updated>
<author>
<name>Jun Aruga</name>
<email>junaruga@users.noreply.github.com</email>
</author>
<published>2023-05-22T12:53:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b0a25c9cf8053c3e9a9a44a62cd54befde4ecdfc'/>
<id>b0a25c9cf8053c3e9a9a44a62cd54befde4ecdfc</id>
<content type='text'>
This reverts commit bbbec4b87c1e66909f5bee9acd3e460b8c1ad663.
Because the commit is a bug. The `apply_timeout_scale` to scale the timeout is
called 2 times in the process.

The `test/ruby/test_thread_queue.rb#test_thr_kill` is calling
`EnvUtil.apply_timeout_scale`, and
calling `tool/lib/core_assertions.rb#assert_normal_exit`.
calling `tool/lib/envutil.rb#invoke_ruby` (`EnvUtil.invoke_ruby`)
calling the `apply_timeout_scale`.

```
$ make test-all V=1 TESTS="-v test/ruby/test_thread_queue.rb -n TestThreadQueue#test_thr_kill --timeout-scale=2"
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit bbbec4b87c1e66909f5bee9acd3e460b8c1ad663.
Because the commit is a bug. The `apply_timeout_scale` to scale the timeout is
called 2 times in the process.

The `test/ruby/test_thread_queue.rb#test_thr_kill` is calling
`EnvUtil.apply_timeout_scale`, and
calling `tool/lib/core_assertions.rb#assert_normal_exit`.
calling `tool/lib/envutil.rb#invoke_ruby` (`EnvUtil.invoke_ruby`)
calling the `apply_timeout_scale`.

```
$ make test-all V=1 TESTS="-v test/ruby/test_thread_queue.rb -n TestThreadQueue#test_thr_kill --timeout-scale=2"
```</pre>
</div>
</content>
</entry>
<entry>
<title>Don't leak pipes. (#7820)</title>
<updated>2023-05-21T23:49:33+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-05-21T23:49:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=872249e209fdb7b7c890a93b0f93a74a62d21aec'/>
<id>872249e209fdb7b7c890a93b0f93a74a62d21aec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Write keyword arguments directly</title>
<updated>2023-03-24T06:41:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-03-24T06:22:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2759cf46f28b1f5ba52f6b7686fd23cb8d792ede'/>
<id>2759cf46f28b1f5ba52f6b7686fd23cb8d792ede</id>
<content type='text'>
`assert_normal_exit` uses keyword arguments since 2013, commit
05dd6b194cc29961a7cecfd5c3852f06dd56a871.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`assert_normal_exit` uses keyword arguments since 2013, commit
05dd6b194cc29961a7cecfd5c3852f06dd56a871.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert and refine tests for uninitialized queue</title>
<updated>2023-03-10T03:03:31+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-03-10T03:03:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7bc000eaa65edd067cd1e4e2ef0041dfdc28b63'/>
<id>a7bc000eaa65edd067cd1e4e2ef0041dfdc28b63</id>
<content type='text'>
`Queue` and `SizedQueue` still check array members.  Only the test of
`ConditionVariable` is useless.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Queue` and `SizedQueue` still check array members.  Only the test of
`ConditionVariable` is useless.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove stale tests</title>
<updated>2023-03-10T02:54:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-03-10T02:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0a466e30726a259907bb6f73557faa22d89545ee'/>
<id>0a466e30726a259907bb6f73557faa22d89545ee</id>
<content type='text'>
These tests were added at a198bb3929a4562a12b4aa245a297c7d3695149f,
when these classes were `Struct`s.  Since these classes have been
rewritten, these tests no longer make sense.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These tests were added at a198bb3929a4562a12b4aa245a297c7d3695149f,
when these classes were `Struct`s.  Since these classes have been
rewritten, these tests no longer make sense.
</pre>
</div>
</content>
</entry>
<entry>
<title>Harden SizedQueue#push timeout test</title>
<updated>2022-08-18T15:16:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-08-18T15:16:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2652b0da6bc1463fc7968d71a6f8897459370514'/>
<id>2652b0da6bc1463fc7968d71a6f8897459370514</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement SizedQueue#push(timeout: sec)</title>
<updated>2022-08-18T08:07:37+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-07-26T15:40:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fe61cad7490da8a879597f851f4a89856d44838e'/>
<id>fe61cad7490da8a879597f851f4a89856d44838e</id>
<content type='text'>
[Feature #18944]

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #18944]

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
</pre>
</div>
</content>
</entry>
</feed>
