Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream specs #1240

Merged
merged 36 commits into from
Jan 30, 2025
Merged

Upstream specs #1240

merged 36 commits into from
Jan 30, 2025

Conversation

andrykonchin
Copy link
Member

@andrykonchin andrykonchin commented Jan 30, 2025

Scheduled specs changes upstreaming from CRuby/JRuby/TruffleRuby

andrykonchin and others added 30 commits January 30, 2025 14:56
Revert the part of commit 10917c5cc026f839a3dcd072b6e274eed211d0f7,
"Update to 18032a7", that discarded the previous commit.
…e install`

But we stub-out GEM_HOME variable for test-bundled-gems and others on ruby/ruby. It means
the installation path mismatched with GEM_HOME variable always. We can't test this example
collectly.

```
1)
Gem.bin_path finds executables of default gems, which are the only files shipped for default gems FAILED
Expected File.exist? "/Users/hsbt/Documents/github.com/ruby/ruby/.bundle/gems/bundler-2.7.0.dev/exe/bundle"
to be truthy but was false
```
…being""

This reverts commit f196750.

These changes lead to failure a Windows job on ruby/spec's CI.
The leaks detector reports that global variables are changed:

```
LeakError: Globals changed: {:verbose=>false, :debug=>false} to {:verbose=>nil, :debug=>false}
```
@andrykonchin
Copy link
Member Author

andrykonchin commented Jan 30, 2025

@nobu Unfortunately I had to revert changes upstreamed from ruby/ruby to have ruby/spec CI passed (0ba6deb).

All the Windows CI jobs (e.g. this one) fail with the following error:

LeakError: Globals changed: {:verbose=>false, :debug=>false} to {:verbose=>nil, :debug=>false}

Wondering if there is another way to solve the issue on Windows. Actually I cannot reproduce any warnings on Windows (I tried on GitHub Actions though).

I've tried to discuss the issue after the last specs syncing and asked in ruby/ruby@99d5e6a#r150964722.

These specs fails with error:

```
Errno::EINVAL: Invalid argument - recvmsg(2)
```

on calling the following methods:

```ruby
client.recvmsg(10)
# or
client.recvmsg_nonblock(10)
```
…emoved

The following error is raised:

```
Dir#chdir does not raise an Errno::ENOENT if the original directory no longer exists ERROR
Errno::ENOENT: No such file or directory @ dir_chdir0 - D:/a/spec/spec/rubyspec_temp/5588_0/27-testdir1
D:/a/spec/spec/core/dir/chdir_spec.rb:192:in `chdir'
D:/a/spec/spec/core/dir/chdir_spec.rb:192:in `block (4 levels) in <top (required)>'
D:/a/spec/spec/core/dir/chdir_spec.rb:191:in `chdir'
D:/a/spec/spec/core/dir/chdir_spec.rb:191:in `block (3 levels) in <top (required)>'
D:/a/spec/spec/core/dir/chdir_spec.rb:129:in `block in <top (required)>'
D:/a/spec/spec/core/dir/chdir_spec.rb:128:in `<top (required)>'
```
@andrykonchin andrykonchin force-pushed the ak/upstream-specs-30-01-2025 branch from 8126f9f to cbbb3c8 Compare January 30, 2025 15:21
@andrykonchin andrykonchin merged commit affef93 into master Jan 30, 2025
34 checks passed
@andrykonchin andrykonchin deleted the ak/upstream-specs-30-01-2025 branch January 30, 2025 15:31
@eregon
Copy link
Member

eregon commented Jan 31, 2025

It's probably related to ruby/win32ole#33
Maybe there can be a more local solution where suppress_warning do ... end is used just around the deprecated constants and/or adapt the specs to the non-deprecated constants if they are available since long enough?

@eregon
Copy link
Member

eregon commented Jan 31, 2025

@nobu @andrykonchin (and I) don't have a Windows dev machine so it's difficult for him to fix it. Could you try to fix it in a way which doesn't permanently modify $VERBOSE and only suppress warnings in small scopes?

@nobu
Copy link
Member

nobu commented Feb 1, 2025

I moved the top level constants for Win32OLE to under Win32OLE module, and deprecated the old names then.
It is OK of course if there is no warnings.

@eregon
Copy link
Member

eregon commented Feb 2, 2025

I don't see any warnings on https://github.com/ruby/ruby/actions/runs/13096898780/job/36540234336#step:22:989
Do you see warnings locally when running win32ole specs with the current master of ruby/ruby?
gems/bundled_gems does have win32ole 1.9.1 https://github.com/ruby/win32ole which should have the deprecations.

@eregon
Copy link
Member

eregon commented Feb 2, 2025

In any case, I think there are two good solutions if you see the warnings:

  • In fixtures/classes.rb declare the new constants if they are not there already, like WIN32OLE::RuntimeError ||= WIN32OLERuntimeError and use the new constants in all specs. Or just the latter if the new constants exist since long enough to pass specs on Ruby 3.0.
  • Reconsider Warning[:deprecated] = true in MSpec, but I think the comment on it makes sense and we should keep it as it is.

@@ -113,6 +113,7 @@
end

ruby_version_is ""..."3.3" do
quarantine! do # May fail with "IO::EAGAINWaitReadable: Resource temporarily unavailable - recvfrom(2) would block" error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say retry on IO::WaitReadable for client.recv_nonblock(10), it just hasn't seen the closed socket yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ruby/ruby#12710

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have no clue why these new specs fail on Windows - they raise Errno::EINVAL: Invalid argument - recvmsg(2)

ccc72c7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants