From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 9AEF81FAEB for ; Sat, 10 Jun 2017 10:35:16 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id A11AC1207FC; Sat, 10 Jun 2017 19:35:14 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id ADF1E1207E1 for ; Sat, 10 Jun 2017 19:35:11 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=h6E6ZhhYDfUm1aD/FpRnNgde4GQ=; b=pasdspAaM8mrzUaWod bFCSBnJCpSvCi6eg2NhogH69AWmjYiXyTcEKC/wC+Mr9LNUdfPW7bW9x1JsrYR// etmVAUPNjF0hsElgj0tSvCn44IIuXQth0zCs5CEzFgRhqkAiGPNhsFX9sTfs9ylc DLP4Po7eZvF/sWuu+tRYozCFQ= Received: by filter0840p1mdw1.sendgrid.net with SMTP id filter0840p1mdw1-4553-593BCB5B-F 2017-06-10 10:35:07.389410158 +0000 UTC Received: from herokuapp.com (ec2-184-73-50-50.compute-1.amazonaws.com [184.73.50.50]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id zjDhRO_2TZ6iPZXyWRvi5w Sat, 10 Jun 2017 10:35:07.266 +0000 (UTC) Date: Sat, 10 Jun 2017 10:35:07 +0000 From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56673 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13644 X-Redmine-Issue-Author: MSP-Greg X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS70iPdu4Pxsev3ammD7y7QQ9g09DfIBW3E2SU WfJsQ8HNs1aySNLWvBKwflK1dkciCKS2Jc9gwsYgN09V/ACXRZpfOoNZe4pbm9c4q/F33mCzSOB1+D KfCDK9Xd7o4CxK5B0LIgSYsVIuyp4TIb42aide0gCE5eWtB9yTId8gW/eA== X-ML-Name: ruby-core X-Mail-Count: 81647 Subject: [ruby-core:81647] [Ruby trunk Bug#13644] Windows - Setting Time.now X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13644 has been updated by nobu (Nobuyoshi Nakada). It's defined in `FakeTime` module which is prepended to `Time`. I haven't seen that failure on mingw. ---------------------------------------- Bug #13644: Windows - Setting Time.now https://bugs.ruby-lang.org/issues/13644#change-65341 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.0dev (2017-06-04 trunk 59013) [x64-mingw32] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- While reviewing a MinGW build `test-all` failure in [TestLogDevice#test_shifting_midnight_exist_file](https://github.com/ruby/ruby/blob/trunk/test/logger/test_logdevice.rb#L687-L727), I determined the cause. The test in question (and other tests that seem to have newer/better exception handling) sets `Time.now`. The thread [StackOverflow - Change system date programmatically](https://stackoverflow.com/questions/650849/change-system-date-programmatically) seems to imply that in some instances/configurations, changing the system time on Windows systems requires elevated permissions. I tested on both a mswin build (`ruby 2.5.0dev (2017-05-27 trunk 58922) [x64-mswin64_140]`) and a MinGW build (`ruby 2.5.0dev (2017-06-08 trunk 59046) [x64-mingw32]`), and both responded to: ```ruby Time.now = Time.mktime(2017, 1, 3, 1, 1, 1) ``` with the following eror: ``` undefined method `now=' for Time:Class (NoMethodError) ``` Both also had `false = Time.respond_to?(:now=)`. So, I'm confused as to how this test passes on mswin. Regardless, the test requires a skip to bypass it and allow MinGW test-all to pass. I thought I'd file an issue before doing a PR. I'm building and testing on Win7. Finally, if anyone has time, where is the method `now=` defined? -- https://bugs.ruby-lang.org/