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
System test test_GetCounters_ShouldOnlyReturnResultsOfLastMinutes sometimes fail #7165
Comments
I think it uses the current timestamp so in case around midnight it might create some users for the previous day etc. |
It has been some time that system tests have not been failing randomly from what I've seen, maybe we can close this one? (or maybe I've just missed those random failures?) |
It is still happening all the time see eg yesterday https://travis-ci.org/piwik/piwik/jobs/55422165#L1021 It just depends on the time see my previous comment. It uses the current timestamp so it cannot work. Unless there was a change? |
If this is still broken, here's an idea to fix: move Date::factory to class called DateFactory. Then access the class through StaticContainer, then override in test DI Config with a mock factory that lets us override the date. What do you think? |
Override the now/today date* |
I've seen this needed in many places, done through private methods overridden using reflection in tests for example. So maybe that could be worth the trouble. |
Still happening https://travis-ci.org/piwik/piwik/jobs/79763078 - somehow we need to fix this random test, or skip it around midnight - in this build the bug only appeared on the MYSQLI and not on PDO |
The method to fetch counter actually uses Maybe we could use
It's just important that this one is by default not cached (in my case I needed it only once anyway). Of course we could also create a class etc to get current |
+1 |
Haven't seen it failing in the last months. Did anyone else? Otherwise guess we could close it now |
Seems to work meanwhile |
The goal of this issue is to investigate the system test
test_GetCounters_ShouldOnlyReturnResultsOfLastMinutes
which randomly fails the build (maybe depending on the speed of running the ci build? or the time? not sure)Examples where the test failed the CI jobs:
The text was updated successfully, but these errors were encountered: