Bug #14375
closed3 Spec failures building MinGW 2018-01-19 trunk 61950
Description
Below are the results of spec tests for 61964. The previous build, ruby 2.6.0dev (2018-01-19 trunk 61949) [x64-mingw32]
did not have these failures.
Thanks, Greg
1)
File#chmod always succeeds with any numeric values FAILED
Expected to not get Exception
but got RangeError (integer -1073741824 too small to convert to `unsigned short')
spec/ruby/core/file/chmod_spec.rb:23:in `block (4 levels) in <top (required)>'
spec/ruby/core/file/chmod_spec.rb:22:in `each'
spec/ruby/core/file/chmod_spec.rb:22:in `block (3 levels) in <top (required)>'
spec/ruby/core/file/chmod_spec.rb:3:in `<top (required)>'
2)
File.chmod always succeeds with any numeric values FAILED
Expected to not get Exception
but got RangeError (integer -1073741824 too small to convert to `unsigned short')
spec/ruby/core/file/chmod_spec.rb:131:in `block (4 levels) in <top (required)>'
spec/ruby/core/file/chmod_spec.rb:130:in `each'
spec/ruby/core/file/chmod_spec.rb:130:in `block (3 levels) in <top (required)>'
spec/ruby/core/file/chmod_spec.rb:111:in `<top (required)>'
3)
File.umask always succeeds with any integer values FAILED
Expected to not get Exception
but got RangeError (integer -1073741824 too small to convert to `unsigned short')
spec/ruby/core/file/umask_spec.rb:37:in `block (3 levels) in <top (required)>'
spec/ruby/core/file/umask_spec.rb:36:in `each'
spec/ruby/core/file/umask_spec.rb:36:in `block (2 levels) in <top (required)>'
spec/ruby/core/file/umask_spec.rb:3:in `<top (required)>'
Files
Updated by MSP-Greg (Greg L) over 7 years ago
- File chmod_umask.patch added
- File chmod_spec.rb chmod_spec.rb added
- File umask_spec.rb added
Attached are three files (one patch, and two spec files from repo). Changes allow it to pass on MinGW. Rearranged things, not sure if that's appropriate (or done correctly)...
Thanks, Greg
Updated by MSP-Greg (Greg L) over 7 years ago
- Subject changed from 3 Spec failures building MinGW 2018-01-20 trunk 61964 to 3 Spec failures building MinGW 2018-01-19 trunk 61950
- ruby -v changed from ruby 2.6.0dev (2018-01-20 trunk 61964) [x64-mingw32] to ruby 2.6.0dev (2018-01-19 trunk 61950) [x64-mingw32]
Updated by MSP-Greg (Greg L) over 7 years ago
- File spec-ruby-core-file-chmod_umask.patch spec-ruby-core-file-chmod_umask.patch added
- File umask_spec.rb umask_spec.rb added
Updated by MSP-Greg (Greg L) over 7 years ago
Please ignore the above files. Patch is located at https://github.com/MSP-Greg/ruby-loco/blob/498b640b81d798c8d69badb7f24738b977caad00/patches/gte20600/spec-ruby-core-file-chmod_umask.patch or https://raw.githubusercontent.com/MSP-Greg/ruby-loco/498b640b81d798c8d69badb7f24738b977caad00/patches/gte20600/spec-ruby-core-file-chmod_umask.patch.
This was applied for current ruby-loco builds, and the builds pass spec tests.
Thanks, Greg
Updated by Eregon (Benoit Daloze) over 7 years ago
- Assignee set to Eregon (Benoit Daloze)
Thanks for the report, I'll take a look.
This spec looks rather hacky at first sight.
Updated by Eregon (Benoit Daloze) over 7 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r62036.
Remove specs trying arbitrary values for chmod and umask
- Instead assert that too large values raise RangeError.
- [Bug #14375] [ruby-core:84933]
- See https://github.com/ruby/ruby/pull/1797
Updated by Eregon (Benoit Daloze) over 7 years ago
Thank you for the report and patches.
I decided to remove the specs trying arbitrary values for chmod/umask in r62036.
So much platform guards is usually a sign we are testing OS/libc-level stuff, which is not really the right thing for ruby/spec (we should test common real-world cases instead).