Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArchiveProcessing: timezone issues #1458

Closed
robocoder opened this issue Jul 3, 2010 · 29 comments
Closed

ArchiveProcessing: timezone issues #1458

robocoder opened this issue Jul 3, 2010 · 29 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Milestone

Comments

@robocoder
Copy link
Contributor

Just started appearing now that it's currently 20:34 EST (now 00:34 UTC).

Fail: ../tests/core/ArchiveProcessing.test.php -> Test_Piwik_ArchiveProcessing -> test_init_today -> Equal expectation fails because [Integer: 1278118800] differs from [Integer: 1278117098] by 1702 at [/home/apang/work/piwik/dev/trunk/tests/core/ArchiveProcessing.test.php line 102]
Fail: ../tests/core/ArchiveProcessing.test.php -> Test_Piwik_ArchiveProcessing -> test_init_today -> Equal expectation fails because [Integer: 1278118800] differs from [Integer: 0] by 1278118800 at [/home/apang/work/piwik/dev/trunk/tests/core/ArchiveProcessing.test.php line 115]
@robocoder
Copy link
Contributor Author

And now at 01:04 EST (05:04 UTC), the unit tests are passing again. So there's a timezone issue here.

@robocoder
Copy link
Contributor Author

Rolling into #818

@robocoder
Copy link
Contributor Author

Re-opening as a separate issue.

@robocoder
Copy link
Contributor Author

Still fails but it looks like it may only be a problem between 20:00 EDT and 21:00 EDT. A bug involving daylight saving time, perhaps? I'll have to debug on another box where I can mess around with the system time...

@robocoder
Copy link
Contributor Author

The ArchiveProcessing tests fail when run between 8 PM and 9 PM EDT. During this hour, I presume no archiving occurs because getMinTimeArchivedProcessed() is > time().

@robocoder
Copy link
Contributor Author

Because this is daylight saving time, this corresponds to UTC+0 to UTC+1. In this unit test, the timezone is set to UTC-1.

@robocoder
Copy link
Contributor Author

(In [2694]) fixes #1458

@robocoder
Copy link
Contributor Author

I think the fix in [2694] might be wrong. The root problem appears to be that $this->startTimestampUTC is already for the next day (based on UTC instead of the site's timezone).

http://forum.piwik.org/index.php?showtopic=13471

@robocoder
Copy link
Contributor Author

(In [2926]) refs #1458 - add date test for America/Vancouver (PST/PDT)

@robocoder
Copy link
Contributor Author

(In [2927]) refs #1458 - cache current time so we avoid the false build failure

@jpfleury
Copy link

With Piwik 0.9 for a site with 15 visits per day, I have stats only for the date range "day", so there's no data for "week", "month" and "year".

If you need access to the Piwik installation, just ask.

@robocoder
Copy link
Contributor Author

See also #1631

@robocoder
Copy link
Contributor Author

(In [3022]) refs #1458 - add conversion test

@robocoder
Copy link
Contributor Author

(In [3025]) refs #1458 - fix indentation

@robocoder
Copy link
Contributor Author

In http://forum.piwik.org/index.php?s=&showtopic=13471&view=findpost&p=61141, it appears we also have an issue with timezone adjustment in core/Controller.php.

@robocoder
Copy link
Contributor Author

(In [3064]) refs #1458 - fixes maxDate issue reported in http://forum.piwik.org/index.php?showtopic=13471 (this is correct in core/Controller.php)

@mattab
Copy link
Member

mattab commented Sep 6, 2010

Anthon, would r3064 fix all problems reported in http://forum.piwik.org/index.php?showtopic=13471&st=20&start=20 ?

If so, maybe we can post patch there and ask users to try it out? thx :)

@robocoder
Copy link
Contributor Author

r3064, just fixes the MultiSites datepicker, so users can't select a future day.

@robocoder
Copy link
Contributor Author

See unit failure in http://qa.piwik.org:8080/hudson/job/Piwik/498/ -- 09/30 6:42 pm.

[exec] <hr/><span class="fail">Fail</span>: /home/www/data/root/hudson.private/jobs/Piwik/workspace/build/tests/core/ArchiveProcessing.test.php -&gt; Test_Piwik_ArchiveProcessing -&gt; test_init_currentMonth -&gt; Equal expectation fails because [Integer: 1285855200] differs from [Integer: 1285768800] by 86400 at [/home/www/data/root/hudson.private/jobs/Piwik/workspace/build/tests/core/ArchiveProcessing.test.php line 58]<br />

[exec] <span class="fail">Fail</span>: /home/www/data/root/hudson.private/jobs/Piwik/workspace/build/tests/core/ArchiveProcessing.test.php -&gt; Test_Piwik_ArchiveProcessing -&gt; test_init_currentMonth -&gt;  at [/home/www/data/root/hudson.private/jobs/Piwik/workspace/build/tests/core/ArchiveProcessing.test.php line 59]<br />

@robocoder
Copy link
Contributor Author

(In [3227]) refs #1458 - fix unit test failure per comment:21

@robocoder
Copy link
Contributor Author

Marking as fixed for now. I've tested this as much as I could (messing with my system time and inspecting the archive tables).

@robocoder
Copy link
Contributor Author

Hang on... I reverted the hack in [2694], and I'm getting weird results in test_init_today. I also added for Europe/Paris and America/Toronto. It looks like internally, there's a timeshifting bug back to UTC-4.

I get errors for:

  • Europe/Paris when my local system time is 18:00-19:59. (22:00-23:59 UTC)
  • America/Toronto when my local system time is 20:00-23:59. (00:00-03:59 UTC)

@robocoder
Copy link
Contributor Author

(In [3246]) fixes #1458, refs #1375 - fix timezone issues

@robocoder
Copy link
Contributor Author

appears to be broken again in trunk

@robocoder
Copy link
Contributor Author

Ah... [3575].

I'll attach the test script and output for your reference matt. Maybe you can fix this regression.

@robocoder
Copy link
Contributor Author

Attachment: Bash script. Run it from the tests/core folder. Disable ntp (or other date/time synchronization daemons).
runit.sh

@robocoder
Copy link
Contributor Author

Attachment: unit test results
archive.txt

@robocoder
Copy link
Contributor Author

Also failing in the CI server. http://qa.piwik.org:8080/hudson/job/Piwik/852/consoleText

@mattab
Copy link
Member

mattab commented Jan 3, 2011

(In [3591]) Fixes #1458 Hopefully this fixes it... it should be correct this time

@robocoder robocoder added this to the Piwik 1.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Projects
None yet
Development

No branches or pull requests

3 participants