<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/digest, 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>[ruby/digest] Alias value to take in old Ruby</title>
<updated>2025-06-03T06:57:30+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-06-03T06:52:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9991edcc41ad55cf79626035637915f1c5d664fb'/>
<id>9991edcc41ad55cf79626035637915f1c5d664fb</id>
<content type='text'>
https://github.com/ruby/digest/commit/1eaee7d4fe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/digest/commit/1eaee7d4fe
</pre>
</div>
</content>
</entry>
<entry>
<title>`Ractor::Port`</title>
<updated>2025-05-30T19:01:33+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-05-26T18:58:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef2bb61018cd9ccb5b61a3d91911e04a773da4a7'/>
<id>ef2bb61018cd9ccb5b61a3d91911e04a773da4a7</id>
<content type='text'>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/digest] Ignore test_ractor.rb on non-Ractor ruby</title>
<updated>2022-07-21T02:45:48+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-21T02:45:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=86b29ef8773c7ff5eaf398e16ffb3ddcb8e37074'/>
<id>86b29ef8773c7ff5eaf398e16ffb3ddcb8e37074</id>
<content type='text'>
https://github.com/ruby/digest/commit/352b8c1636
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/digest/commit/352b8c1636
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/digest] Find an available digest algorithm to test</title>
<updated>2022-07-21T00:58:46+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-21T00:57:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4a7ecc1bd9135916fd4ca246a47926c32ce72508'/>
<id>4a7ecc1bd9135916fd4ca246a47926c32ce72508</id>
<content type='text'>
https://github.com/ruby/digest/commit/8844716793
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/digest/commit/8844716793
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/digest] Use pend instead of skip</title>
<updated>2021-07-28T02:48:36+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2021-06-01T11:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be4b0eee1980612f74314e5066d264b661aad040'/>
<id>be4b0eee1980612f74314e5066d264b661aad040</id>
<content type='text'>
https://github.com/ruby/digest/commit/82fb618157
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/digest/commit/82fb618157
</pre>
</div>
</content>
</entry>
<entry>
<title>[digest] Make digest Ractor safe</title>
<updated>2020-12-19T06:08:01+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-16T14:04:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b66f52b0e374d298cbd3a68029226dc1ccd77554'/>
<id>b66f52b0e374d298cbd3a68029226dc1ccd77554</id>
<content type='text'>
https://github.com/ruby/digest/commit/c13a024b85
https://github.com/ruby/digest/commit/9edca3f8be
https://github.com/ruby/digest/commit/378b56b6ca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/digest/commit/c13a024b85
https://github.com/ruby/digest/commit/9edca3f8be
https://github.com/ruby/digest/commit/378b56b6ca
</pre>
</div>
</content>
</entry>
<entry>
<title>test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeout</title>
<updated>2020-03-27T06:32:52+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2020-03-27T06:31:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=16c90f0678751e96cd8ddfa426ecdabfde10a28c'/>
<id>16c90f0678751e96cd8ddfa426ecdabfde10a28c</id>
<content type='text'>
The test seems to fail sometimes due to a warning message of circular
require on very slow machine.

```
  1) Failure:
TestDigest::TestDigestParen#test_race_mixed [/export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/test_digest.rb:263]:
assert_separately failed with error message
pid 12458 exit 0
| /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: loading in progress, circular require considered harmful - /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/digest/foo.rb
| 	from -:10:in  `block (2 levels) in &lt;main&gt;'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `const_missing'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `require'
|
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200326T091911Z.fail.html.gz
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test seems to fail sometimes due to a warning message of circular
require on very slow machine.

```
  1) Failure:
TestDigest::TestDigestParen#test_race_mixed [/export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/test_digest.rb:263]:
assert_separately failed with error message
pid 12458 exit 0
| /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: loading in progress, circular require considered harmful - /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/digest/foo.rb
| 	from -:10:in  `block (2 levels) in &lt;main&gt;'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `const_missing'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `require'
|
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200326T091911Z.fail.html.gz
</pre>
</div>
</content>
</entry>
<entry>
<title>Restore support library for only test files that are digest and csv.</title>
<updated>2019-07-09T12:16:49+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2019-07-09T12:16:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9f275f7971ee7e659e0965122b2bb57e785d0181'/>
<id>9f275f7971ee7e659e0965122b2bb57e785d0181</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>with_different_ofs.rb has been moved too</title>
<updated>2019-07-02T00:43:33+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-07-02T00:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=832b5094722477598c7f720584fb54c4b2f18228'/>
<id>832b5094722477598c7f720584fb54c4b2f18228</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix tests which fail with extra stderr output when a Thread dies</title>
<updated>2017-12-12T18:44:21+00:00</updated>
<author>
<name>eregon</name>
<email>eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-12-12T18:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6671a826ac0531fb8df2b3fceb726f66ddcce5af'/>
<id>6671a826ac0531fb8df2b3fceb726f66ddcce5af</id>
<content type='text'>
* [Feature #14143] [ruby-core:83979].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* [Feature #14143] [ruby-core:83979].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
