<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby.git/test/ruby/test_require.rb, branch master</title>
<subtitle>github.com: ruby/ruby.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/'/>
<entry>
<title>Fix small issues concerning namespacing in test-all suite</title>
<updated>2023-03-16T23:46:37+00:00</updated>
<author>
<name>lukeg</name>
<email>luke.gru@gmail.com</email>
</author>
<published>2023-03-13T22:13:21+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=d2c6dca8f4a9fb3e6b9748758ee9eb75fa18622a'/>
<id>d2c6dca8f4a9fb3e6b9748758ee9eb75fa18622a</id>
<content type='text'>
* Fix temporary methods on Object leaking across test cases.
* Remove temporary classes/modules leaking across test cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix temporary methods on Object leaking across test cases.
* Remove temporary classes/modules leaking across test cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only emit circular dependency warning for owned thread shields</title>
<updated>2023-02-08T08:50:00+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2023-02-06T22:30:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=8ce2fb9bbbaea14737c84385b1573f743a30f773'/>
<id>8ce2fb9bbbaea14737c84385b1573f743a30f773</id>
<content type='text'>
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Only emit circular dependency warning for owned thread shields"</title>
<updated>2023-02-06T22:30:35+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2023-02-06T22:30:00+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=c19defd02665492de7147572714ebe692260c849'/>
<id>c19defd02665492de7147572714ebe692260c849</id>
<content type='text'>
This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only emit circular dependency warning for owned thread shields</title>
<updated>2023-02-06T18:35:38+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-02-06T11:30:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=fa49651e05a06512e18ccb2f54a7198c9ff579de'/>
<id>fa49651e05a06512e18ccb2f54a7198c9ff579de</id>
<content type='text'>
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #19415]

If multiple threads attemps to load the same file concurrently
it's not a circular dependency issue.

So we check that the existing ThreadShield is owner by the current
fiber before warning about circular dependencies.
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip failing test with freebsd</title>
<updated>2022-05-31T02:40:38+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-05-31T02:40:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=0cae30e1d3d782d11dd413d6c713bf60c79ddc67'/>
<id>0cae30e1d3d782d11dd413d6c713bf60c79ddc67</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use omit instead of skip: test/ruby/**/*.rb</title>
<updated>2022-01-04T08:25:30+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-01-04T08:25:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=47bf64a26d3d95a312ea5cf5d94ee1d2104f5e26'/>
<id>47bf64a26d3d95a312ea5cf5d94ee1d2104f5e26</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow Kernel#load to load code into a specified module</title>
<updated>2021-11-18T06:43:40+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-10-18T15:50:10+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=b35b7a1ef25347735a6bb7c28ab7e77afea1d856'/>
<id>b35b7a1ef25347735a6bb7c28ab7e77afea1d856</id>
<content type='text'>
Instead of always using a new anonymous module for Kernel#load if
the wrap argument is not false/nil, use the given module if a module
is provided.

Implements [Feature #6210]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of always using a new anonymous module for Kernel#load if
the wrap argument is not false/nil, use the given module if a module
is provided.

Implements [Feature #6210]
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not load file with same realpath twice when requiring</title>
<updated>2021-10-02T14:51:29+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-06-30T20:50:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=79a4484a072e9769b603e7b4fbdb15b1d7eccb15'/>
<id>79a4484a072e9769b603e7b4fbdb15b1d7eccb15</id>
<content type='text'>
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.

It took me multiple attempts to get this working.  My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES.  Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.

This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.

When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt.  I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.

Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.

To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.

Fixes [Bug #17885]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.

It took me multiple attempts to get this working.  My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES.  Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.

This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.

When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt.  I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.

Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.

To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.

Fixes [Bug #17885]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the encoding of loaded feature names [Bug #18191]</title>
<updated>2021-10-01T11:28:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-09-27T16:32:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=60d0421ca861944459f52292d65dbf0ece26e38a'/>
<id>60d0421ca861944459f52292d65dbf0ece26e38a</id>
<content type='text'>
The feature names loaded from the default load paths should also
be in the file system encoding.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The feature names loaded from the default load paths should also
be in the file system encoding.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Do not load file with same realpath twice when requiring"</title>
<updated>2021-09-19T00:37:35+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-09-19T00:37:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=162ad65fdd5e3f826eff4e0208c58a21151e993a'/>
<id>162ad65fdd5e3f826eff4e0208c58a21151e993a</id>
<content type='text'>
This reverts commit ddb85c5d2bdf75a83eb163856508691a7436b446.

This commit causes unexpected warnings in TestTranscode#test_loading_race
occasionally in CI.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit ddb85c5d2bdf75a83eb163856508691a7436b446.

This commit causes unexpected warnings in TestTranscode#test_loading_race
occasionally in CI.
</pre>
</div>
</content>
</entry>
</feed>
