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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 CCCBF1F8CF for ; Fri, 9 Jun 2017 22:32:30 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D46E31207CB; Sat, 10 Jun 2017 07:32:28 +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 E96101207C7 for ; Sat, 10 Jun 2017 07:32:26 +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=fe7FhG03ZYOwYuXGbznTX4gWn4Y=; b=oGxGYciQbCFPlc/Hqz sbsVcCu89C4wM+YuzSSYlbRm7dl68eQEN0LnOlXEkyrSWEp5/PyjYdAW87hY+B7c OmIse0Kqw0d3iFqNLMOXrdswORjeNtiy9ApLutMDfapnoExY0wTU3lkqPabtcg3P o3QZxzD7LvTp+haUTzXZR61Sk= Received: by filter1080p1mdw1.sendgrid.net with SMTP id filter1080p1mdw1-9597-593B21F6-5 2017-06-09 22:32:22.391558911 +0000 UTC Received: from herokuapp.com (ec2-54-144-69-20.compute-1.amazonaws.com [54.144.69.20]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id l3JipsHiRsepmjuFfWL4qQ Fri, 09 Jun 2017 22:32:22.357 +0000 (UTC) Date: Fri, 09 Jun 2017 22:32:22 +0000 From: Greg.mpls@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56670 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13644 X-Redmine-Issue-Author: MSP-Greg X-Redmine-Sender: MSP-Greg 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6Yw5XN73lCPIWgna6EBIe9ms5kQX8e2Ypj4t Zy159bQO8tuwsADvdZIHvFNWAUPWAwzTSW5CSWkngevh4X10R5i0U9YvymTKduv5P+3nr5BgeDBDrJ MS/vzOjAtVs0h46o0ZDuUaKOxCBY/OJqgXWIS2QFrrs447aVa5/NV1q0fw== X-ML-Name: ruby-core X-Mail-Count: 81644 Subject: [ruby-core:81644] [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 MSP-Greg (Greg L). ruby -v set to ruby 2.5.0dev (2017-06-04 trunk 59013) [x64-mingw32] Submitted [PR #1645](https://github.com/ruby/ruby/pull/1645) Re tests, this PR changes a file used in test-all, which passes on both appveyor and travis. Spec tests failed on appveyor with a failure that I have intermittently seen on MinGW builds. ---------------------------------------- Bug #13644: Windows - Setting Time.now https://bugs.ruby-lang.org/issues/13644#change-65337 * 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/