<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_file_exhaustive.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Skip some tests which don't work under permissionless containers</title>
<updated>2024-08-22T23:34:41+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2024-08-08T11:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8800127d80fb1063a186ced65af445e79a518924'/>
<id>8800127d80fb1063a186ced65af445e79a518924</id>
<content type='text'>
When running as UID 0 but without CAP_DAC_OVERRIDE (for example, in a
docker container running with --uid 0 but --cap-drop=all), these tests
won't work because of hard-coded assumptions about what uid 0 can and
can't do.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When running as UID 0 but without CAP_DAC_OVERRIDE (for example, in a
docker container running with --uid 0 but --cap-drop=all), these tests
won't work because of hard-coded assumptions about what uid 0 can and
can't do.
</pre>
</div>
</content>
</entry>
<entry>
<title>Extend timeout in test/ruby/test_file_exhaustive.rb</title>
<updated>2024-08-03T07:30:32+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-08-03T06:42:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b708661313246bb17e349f8f90c663c5e286a1c8'/>
<id>b708661313246bb17e349f8f90c663c5e286a1c8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use `File::NULL` instead of hard coded null device names</title>
<updated>2023-07-10T10:21:47+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-07-10T10:18:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c8d0470bb0888bcb6719ba536e5f3f6a8b6551bb'/>
<id>c8d0470bb0888bcb6719ba536e5f3f6a8b6551bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip time-related assertions on /dev/null</title>
<updated>2023-01-13T03:26:16+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-01-13T03:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b36fefc4e7d0bbaf714fd230c409193d544bcfc'/>
<id>5b36fefc4e7d0bbaf714fd230c409193d544bcfc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for `sockaddr_un` on Windows. (#6513)</title>
<updated>2022-11-17T22:50:25+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-11-17T22:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ea8a7287e2b96b9c24e5e89fe863e5bfa60bfdda'/>
<id>ea8a7287e2b96b9c24e5e89fe863e5bfa60bfdda</id>
<content type='text'>
* Windows: Fix warning about undefined if_indextoname()

* Windows: Fix UNIXSocket on MINGW and make .pair more reliable

* Windows: Use nonblock=true for read tests with scheduler

* Windows: Move socket detection from File.socket? to File.stat

Add S_IFSOCK to Windows and interpret reparse points accordingly.
Enable tests that work now.

* Windows: Use wide-char functions to UNIXSocket

This fixes behaviour with non-ASCII characters.
It also fixes deletion of temporary UNIXSocket.pair files.

* Windows: Add UNIXSocket tests for specifics of Windows impl.

* Windows: fix VC build due to missing _snwprintf

Avoid usage of _snwprintf, since it fails linking ruby.dll like so:

  linking shared-library x64-vcruntime140-ruby320.dll
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l

whereas linking miniruby.exe succeeds.

This patch uses snprintf on the UTF-8 string instead.

Also remove branch GetWindowsDirectoryW, since it doesn't work.

* Windows: Fix dangling symlink test failures

Co-authored-by: Lars Kanis &lt;kanis@comcard.de&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Windows: Fix warning about undefined if_indextoname()

* Windows: Fix UNIXSocket on MINGW and make .pair more reliable

* Windows: Use nonblock=true for read tests with scheduler

* Windows: Move socket detection from File.socket? to File.stat

Add S_IFSOCK to Windows and interpret reparse points accordingly.
Enable tests that work now.

* Windows: Use wide-char functions to UNIXSocket

This fixes behaviour with non-ASCII characters.
It also fixes deletion of temporary UNIXSocket.pair files.

* Windows: Add UNIXSocket tests for specifics of Windows impl.

* Windows: fix VC build due to missing _snwprintf

Avoid usage of _snwprintf, since it fails linking ruby.dll like so:

  linking shared-library x64-vcruntime140-ruby320.dll
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l

whereas linking miniruby.exe succeeds.

This patch uses snprintf on the UTF-8 string instead.

Also remove branch GetWindowsDirectoryW, since it doesn't work.

* Windows: Fix dangling symlink test failures

Co-authored-by: Lars Kanis &lt;kanis@comcard.de&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Skip failing test on FreeBSD [ci skip]</title>
<updated>2022-06-17T05:37:15+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-06-17T05:37:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=20d4168250fb1f534cf2db7c44998b25252a70f8'/>
<id>20d4168250fb1f534cf2db7c44998b25252a70f8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip failing test with freebsd</title>
<updated>2022-05-30T09:40:31+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-05-30T09:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a78f003c30dde0a303eb15fc073bc6c57df1cfc2'/>
<id>a78f003c30dde0a303eb15fc073bc6c57df1cfc2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Compare predicate methods as a boolean value</title>
<updated>2022-04-15T08:14:29+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-04-15T02:17:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9db7d95968a832dd095eccf9cfe29255ac15b2c2'/>
<id>9db7d95968a832dd095eccf9cfe29255ac15b2c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Win32] Fix mode of character/pipe device stat [Bug #18732]</title>
<updated>2022-04-15T08:14:29+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-04-14T17:33:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a0040af6715d85f416f1282588974e151a8164eb'/>
<id>a0040af6715d85f416f1282588974e151a8164eb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use an empty string when building File.expand_path</title>
<updated>2022-04-12T13:54:57+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-04-12T13:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=381475f02e6b44ae729f9403637b30c445b622e5'/>
<id>381475f02e6b44ae729f9403637b30c445b622e5</id>
<content type='text'>
Allocating a string of length MAXPATHLEN and then shrinking the string
is inefficient when the resulting path is short. Preallocating a large
string is also a problem for Variable Width Allocation since we can't
easily downsize the capacity.

I ran the following benchmark:

```ruby
Benchmark.ips do |x|
  {
    "empty" =&gt; "",
    "short" =&gt; "a/" * 10,
    "medium" =&gt; "a/" * 100,
    "long" =&gt; "a/" * 500
  }.each do |name, path|
    x.report(name) do |times|
      i = 0
      while i &lt; times
        File.expand_path(path)
        i += 1
      end
    end
  end
end
```

On this commit:

```
 empty     97.486k (± 0.7%) i/s -    492.915k in   5.056507s
 short     96.026k (± 2.4%) i/s -    486.489k in   5.068966s
medium     86.304k (± 1.3%) i/s -    435.336k in   5.045112s
  long     59.395k (± 1.7%) i/s -    302.175k in   5.089026s
```

On master:

```
 empty     94.138k (± 1.4%) i/s -    472.158k in   5.016590s
 short     92.043k (± 1.4%) i/s -    468.180k in   5.087496s
medium     84.910k (± 2.3%) i/s -    425.750k in   5.017007s
  long     61.503k (± 2.7%) i/s -    309.723k in   5.039429s
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allocating a string of length MAXPATHLEN and then shrinking the string
is inefficient when the resulting path is short. Preallocating a large
string is also a problem for Variable Width Allocation since we can't
easily downsize the capacity.

I ran the following benchmark:

```ruby
Benchmark.ips do |x|
  {
    "empty" =&gt; "",
    "short" =&gt; "a/" * 10,
    "medium" =&gt; "a/" * 100,
    "long" =&gt; "a/" * 500
  }.each do |name, path|
    x.report(name) do |times|
      i = 0
      while i &lt; times
        File.expand_path(path)
        i += 1
      end
    end
  end
end
```

On this commit:

```
 empty     97.486k (± 0.7%) i/s -    492.915k in   5.056507s
 short     96.026k (± 2.4%) i/s -    486.489k in   5.068966s
medium     86.304k (± 1.3%) i/s -    435.336k in   5.045112s
  long     59.395k (± 1.7%) i/s -    302.175k in   5.089026s
```

On master:

```
 empty     94.138k (± 1.4%) i/s -    472.158k in   5.016590s
 short     92.043k (± 1.4%) i/s -    468.180k in   5.087496s
medium     84.910k (± 2.3%) i/s -    425.750k in   5.017007s
  long     61.503k (± 2.7%) i/s -    309.723k in   5.039429s
```
</pre>
</div>
</content>
</entry>
</feed>
