These are chat archives for getredash/redash

25th
Oct 2016
Allen Short
@washort
Oct 25 2016 14:19
I'm seeing tests failing locally due to timezone issues -- models.QueryResult.get_latest compares retrieved_at to the current UTC time and fails when the local timezone isn't UTC. Have you seen this before?
Arik Fraimovich
@arikfr
Oct 25 2016 14:31
@washort nope
@washort which test is it?
Allen Short
@washort
Oct 25 2016 14:58
@arikfr tests.test_models:QueryResultTest.test_get_latest_returns_when_found for instance
do you run tests with something other than just nosetests tests?
Arik Fraimovich
@arikfr
Oct 25 2016 15:01
I either use nosetests or PyCharm.
It also works in the CI :\ Can you post the full stacktrace of the error you're having?
Allen Short
@washort
Oct 25 2016 15:18
Hmm. I just refreshed dependencies in my virtualenv and now it's working. False alarm :-|
Arik Fraimovich
@arikfr
Oct 25 2016 15:18
:+1:
Allen Short
@washort
Oct 25 2016 15:38
oops! now it passes when run by itself, but when run in the full suite it still fails!
@arikfr here is the failing test and the fix i tried https://gist.github.com/washort/470a6703a68a412a8f963b5e691b4daf
Allen Short
@washort
Oct 25 2016 15:46
hmm. still 60 more tests that don't pass. (Lots with "301 != 302", etc)
I probably really messed something up.
washort @washort tries with a fresh checkout in another directory
Allen Short
@washort
Oct 25 2016 15:54
-- oh, the tests don't create a separate db!
Allen Short
@washort
Oct 25 2016 17:00
Hmm. That isn't it either...
Allen Short
@washort
Oct 25 2016 21:20
@arikfr OK. With a fresh checkout, I get 3 test failures that the above patch fixes.
(Many of the others, I think, came from not installing the other data-source dependencies.)
Arik Fraimovich
@arikfr
Oct 25 2016 21:22
I think we had it simply as retrieved_at vs. retrieved_at at time zone utc because we make sure to insert UTC based timestamps there, but I'm not sure as I didn't check the code yet.
Your change seems legit but I wonder if it might break existing deployments somehow :O
Allen Short
@washort
Oct 25 2016 21:24
well, the test doesn't insert utc timestamps :-/
Arik Fraimovich
@arikfr
Oct 25 2016 21:24
so weird
my machine isn't on utc but it still works
i wonder if it's pure luck
and you having an issue as you're behind utc while I'm ahead ...
Allen Short
@washort
Oct 25 2016 22:53
hmm, i should try changing my timezone :)
Allen Short
@washort
Oct 25 2016 23:05
Yes, setting my timezone in postgres and in the test process to 'Israel' makes the test failure go away.