<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21222</bug_id>
          
          <creation_ts>2013-03-08 14:06:31 +0000</creation_ts>
          <short_desc>Tests that depend on a fixed timezone (UTC)</short_desc>
          <delta_ts>2013-07-04 13:46:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christian Gruen">christian.gruen</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</cc>
    
    <cc>tim</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84119</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-03-08 14:06:31 +0000</bug_when>
    <thetext>A number of tests in the QT3TS seem to depend on a fixed timezone (UTC). Below, I have listed the names of the tests along with

a) the expected results of the test suite, and
b) the results I would expect for time zone +01:00:

- cbcl-gDay-equal-019 : false; true
- cbcl-gDay-equal-020 : false; true
- cbcl-gMonthDay-equal-019 : false; true
- cbcl-gMonthDay-equal-020 : false; true
- cbcl-subtract-dates-003 : P2192DT1H; P2192D
- cbcl-subtract-dates-004 : -P2192DT1H; -P2192D
- cbcl-subtract-dateTimes-003 : P2192DT1H; P2192D
- cbcl-subtract-dateTimes-004 : -P2192DT1H; -P2192D
- cbcl-subtract-times-001 : -PT1H; PT0S
- cbcl-subtract-times-002 : PT1H; PT0S
- cbcl-subtract-times-003 : PT9H; PT8H
- cbcl-subtract-times-004 : -PT9H; -PT8H
- cbcl-time-equal-019 : false; true
- cbcl-time-greater-than-004 : false; true
- cbcl-time-greater-than-005 : true; false
- cbcl-time-greater-than-009 : true; false
- cbcl-time-greater-than-010 : false; true
- cbcl-time-less-than-004 : true; false
- cbcl-time-less-than-005 : false; true
- cbcl-time-less-than-009 : false; true
- cbcl-time-less-than-010 : true; false</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84412</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-14 13:34:06 +0000</bug_when>
    <thetext>I&apos;d like to resolve these with a feature dependency.  I suggest adding &quot;implicit-timezone&quot; to dependencyEnumType, and using

 &lt;dependency type=&quot;implicit-timezone&quot; value=&quot;PT0S&quot;/&gt;

on the tests.

If O&apos;Neil agrees and updates the schema, I&apos;ll make the change to the affected tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84419</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-03-14 14:39:37 +0000</bug_when>
    <thetext>That&apos;s tricky because implicit-timezone() is required to be consistent with current-dateTime(), therefore implementations might not be able to set it independently. And they certainly might have difficulty setting it to different values in the course of a single test run (because it might require changing the system clock).

Also, since we&apos;ve called for test results, I don&apos;t particular want to make people change their test drivers at this juncture.

I would prefer a solution that eliminates the dependency, e.g. change cbcl-gDay-equal-019 to

xs:gDay(&quot;---31+00:15&quot;) eq xs:gDay(&quot;---31&quot;)

(we can safely assume that no-one is running with implicit timezone = +00:15, even though it is legal)

Similarly change cbcl-subtract-dates-003 to

xs:date(&quot;2008-12-31&quot;) - xs:date(&quot;2002-12-31+01:00&quot;) - implicit-timezone()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84481</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-15 16:48:23 +0000</bug_when>
    <thetext>A fix has been attempted for

- cbcl-gDay-equal-019 
- cbcl-gDay-equal-020 
- cbcl-gMonthDay-equal-019 
- cbcl-gMonthDay-equal-020 
- cbcl-subtract-dates-003 
- cbcl-subtract-dates-004 
- cbcl-subtract-dateTimes-003 
- cbcl-subtract-dateTimes-004 
- cbcl-subtract-times-001
- cbcl-subtract-times-002 
- cbcl-subtract-times-003 
- cbcl-subtract-times-004 
- cbcl-time-equal-019 

and some other similar tests.  Please confirm that the fixes work.

Suggestions are welcome to resolve the problems with

- cbcl-time-greater-than-004 
- cbcl-time-greater-than-005 
- cbcl-time-greater-than-009 
- cbcl-time-greater-than-010 
- cbcl-time-less-than-004 
- cbcl-time-less-than-005 
- cbcl-time-less-than-009 
- cbcl-time-less-than-010</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84483</commentid>
    <comment_count>4</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-03-15 19:21:02 +0000</bug_when>
    <thetext>The fixes for the following tests look perfect to me:

- cbcl-gMonthDay-equal-019 
- cbcl-gMonthDay-equal-020 
- cbcl-subtract-dates-003 
- cbcl-subtract-dates-004 
- cbcl-subtract-dateTimes-003 
- cbcl-subtract-dateTimes-004 
- cbcl-subtract-times-001
- cbcl-subtract-times-002 
- cbcl-subtract-times-003 
- cbcl-subtract-times-004 

I’m not sure about the following ones, though:

- cbcl-gDay-equal-019 
- cbcl-gDay-equal-020 
- cbcl-time-equal-019 

As I assume that the timezone check (+PT1M) will never be true, I guess that the second branch will be chosen in all cases, which always gives me &quot;false&quot; in my timezone. The following query should yield &quot;true&quot; everywhere on this globe:

  xs:gDay(&quot;---31+00:01&quot;) ne xs:gDay(&quot;---31&quot;)

&gt; Suggestions are welcome to resolve the problems with
&gt;
&gt; - cbcl-time-greater-than-004 
&gt; ...

These queries could as well be resolved with artificial timezones, such as...

  xs:time(&quot;00:00:00+00:01&quot;) gt xs:time(&quot;00:00:00&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84551</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-18 09:33:36 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; The fixes for the following tests look perfect to me:

&gt; I’m not sure about the following ones, though:
&gt; 
&gt; - cbcl-gDay-equal-019 
&gt; - cbcl-gDay-equal-020 
&gt; - cbcl-time-equal-019 

That was an unintentional typo - now fixed.  Please confirm that you are happy with the change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84552</commentid>
    <comment_count>6</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-03-18 09:49:44 +0000</bug_when>
    <thetext>I am happy! Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84556</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-18 11:01:36 +0000</bug_when>
    <thetext>The tests:

- cbcl-time-greater-than-004 
- cbcl-time-greater-than-005 
- cbcl-time-greater-than-009 
- cbcl-time-greater-than-010 
- cbcl-time-less-than-004 
- cbcl-time-less-than-005 
- cbcl-time-less-than-009 
- cbcl-time-less-than-010

are now fixed - hopefully in a timezone independent manner.

Please mark as CLOSED if you agree with the resolution.  Otherwise, REOPEN.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84926</commentid>
    <comment_count>8</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-03-25 16:20:19 +0000</bug_when>
    <thetext>The following test also depends on the current timezone:

Name:
  cbcl-distinct-values-003

Query:
  distinct-values((
    xs:dateTime(&quot;2008-01-01T13:00:00&quot;),
    xs:dateTime(&quot;2008-01-01T13:00:00+00:00&quot;)
  ))

Currently expected result:
  one item

Returned result:
  one or two items

Once again, we could use a non-existing time zone and expect two items as result:

  distinct-values((
    xs:dateTime(&quot;2008-01-01T13:00:00+00:00&quot;),
    xs:dateTime(&quot;2008-01-01T13:00:00+00:01&quot;)
  ))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85110</commentid>
    <comment_count>9</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-28 17:31:48 +0000</bug_when>
    <thetext>I&apos;ve attempted a fix.

Please mark as CLOSED if you agree with the resolution.  Otherwise, REOPEN.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89895</commentid>
    <comment_count>10</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-06-26 13:54:32 +0000</bug_when>
    <thetext>&quot;cbcl-hash-join-3&quot; is another (and presumably the last) test case that depends on UTC as fixed timezone:

  for $x in (xs:date(&quot;2010-10-10&quot;),
             xs:date(&quot;1997-01-01+12:00&quot;),
             xs:date(&quot;1997-01-02+12:00&quot;))
  for $y in (xs:date(&quot;2010-10-10Z&quot;),
             xs:date(&quot;2010-10-10+01:00&quot;),
             xs:date(&quot;1997-01-01-12:00&quot;))
  where $x = $y
  return $x

In essence, xs:date(&quot;2010-10-10&quot;) = xs:date(&quot;2010-10-10+01:00&quot;) returns false for most timezones.

The test case could also be rewritten by removing the implicit timezone, or an alternative result could be added (&quot;1997-01-02+12:00&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90349</commentid>
    <comment_count>11</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-07-04 12:43:12 +0000</bug_when>
    <thetext>Fixed.

Please mark as CLOSED if you agree with the resolution.  Otherwise, REOPEN.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90350</commentid>
    <comment_count>12</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-07-04 13:46:39 +0000</bug_when>
    <thetext>Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>