Project

General

Profile

Bug #16410

Spec failure - "File.utime allows Time instances in the far future to set mtime and atime"

Added by vo.x (Vit Ondruch) 7 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-12-09 master c2dc27d643) [x86_64-linux]
[ruby-core:96169]
Tags:

Description

I observe the following spec error:

$ make test-all TESTS="spec/ruby/core/file/utime_spec.rb" MSPECOPT="-fs"
./revision.h unchanged
ruby 2.7.0dev (2019-12-09 master c2dc27d643) [x86_64-linux]

1)
File.utime allows Time instances in the far future to set mtime and atime FAILED
Expected 2446 == 559444
to be truthy but was false
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/spec/ruby/core/file/utime_spec.rb:78:in `block (4 levels) in <top (required)>'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/spec/ruby/core/file/utime_spec.rb:3:in `<top (required)>'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/spec/ruby/spec_helper.rb:31:in `<top (required)>'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/spec/ruby/core/file/utime_spec.rb:1:in `require_relative'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/spec/ruby/core/file/utime_spec.rb:1:in `<top (required)>'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:963:in `require'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:963:in `block in non_options'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:957:in `each'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:957:in `non_options'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:65:in `process_args'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:131:in `process_args'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:1151:in `process_args'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:1156:in `run'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/lib/test/unit.rb:1163:in `run'
/builddir/build/BUILD/ruby-2.7.0-c2dc27d643/tool/test/runner.rb:22:in `<top (required)>'
./test/runner.rb:11:in `require_relative'
./test/runner.rb:11:in `<main>'
[/ | ==================100%================== | 00:00:00]      1F      0E 

Finished in 0.009331 seconds

2 files, 5 examples, 15 expectations, 1 failure, 0 errors, 0 tagged
make: *** [uncommon.mk:782: yes-test-all] Error 1

Updated by mame (Yusuke Endoh) 7 months ago

I cannot reproduce the issue on Ubuntu with ext4 filesystem.

$ make test-all TESTS="spec/ruby/core/file/utime_spec.rb" MSPECOPT="-fs"
ruby 2.7.0dev (2019-12-09T11:48:35Z master c2dc27d643) [x86_64-linux]
[| | ==================100%================== | 00:00:00]      0F      0E 

Finished in 0.002229 seconds

2 files, 5 examples, 16 expectations, 0 failures, 0 errors, 0 tagged

I'm not familiar with file system at all, but I guess it depends upon whether 64-bit timestamp is supported or not. What Linux distribution, kernel version, glibc, and file system are you using?

Updated by vo.x (Vit Ondruch) 7 months ago

$ cat /etc/os-release 
NAME=Fedora
VERSION="32 (Rawhide)"
ID=fedora
VERSION_ID=32
VERSION_CODENAME=""
PLATFORM_ID="platform:f32"
PRETTY_NAME="Fedora 32 (Rawhide)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:32"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=rawhide
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"

$ uname -a
Linux 279feb6400424441b3fc1b2fed5f110b 5.4.0-2.fc32.x86_64 #1 SMP Mon Nov 25 22:45:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ rpm -q glibc
glibc-2.30.9000-25.fc32.x86_64

The system I am using for testing is actually running in systemd-nspawn container on Ext4.

Updated by vo.x (Vit Ondruch) 7 months ago

BTW preciously, I was testing against 053f78e139 where the bug had not been present yet.

Updated by nobu (Nobuyoshi Nakada) 7 months ago

Could you check the path of @file1 in that file, and the filesystem of that volume?

#5

Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

  • Status changed from Open to Closed

Also available in: Atom PDF