Skip to content
Snippets Groups Projects
Commit 093fb27a authored by Ryan Senior's avatar Ryan Senior Committed by GitHub
Browse files

Merge pull request #5922 from metabase/fix-vertica-tz-race-condition

Fix a vertica test race condition in the unix timestamp tests
parents 619570fc 348aa89e
No related branches found
No related tags found
No related merge requests found
......@@ -9,16 +9,21 @@
[datasets :as datasets :refer [*driver* *engine*]]
[interface :as i]]))
;; There were 9 "sad toucan incidents" on 2015-06-02
;; There were 10 "sad toucan incidents" on 2015-06-02 in UTC
(expect-with-non-timeseries-dbs
(if (i/has-questionable-timezone-support? *driver*)
10
9)
(count (rows (data/dataset sad-toucan-incidents
(data/run-query incidents
(ql/filter (ql/and (ql/> $timestamp "2015-06-01")
(ql/< $timestamp "2015-06-03")))
(ql/order-by (ql/asc $timestamp)))))))
10
;; There's a race condition with this test. If we happen to grab a
;; connection that is in a session with the timezone set to pacific,
;; we'll get 9 results even when the above if statement is true. It
;; seems to be pretty rare, but explicitly specifying UTC will make
;; the issue go away
(tu/with-temporary-setting-values [report-timezone "UTC"]
(count (rows (data/dataset sad-toucan-incidents
(data/run-query incidents
(ql/filter (ql/and (ql/> $timestamp "2015-06-01")
(ql/< $timestamp "2015-06-03")))
(ql/order-by (ql/asc $timestamp))))))))
(expect-with-non-timeseries-dbs
(cond
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment