@@ -34,7 +34,7 @@ defmodule Lightning.PartitionTableServiceTest do
34
34
test "removes obsolete partitions" do
35
35
parent = "work_orders"
36
36
37
- now = DateTime . now! ( "Etc/UTC" )
37
+ now = DateTime . utc_now ( )
38
38
39
39
drop_range_partitions ( parent )
40
40
@@ -75,7 +75,7 @@ defmodule Lightning.PartitionTableServiceTest do
75
75
end
76
76
77
77
test "tables_to_add returns tables that do not already exist" do
78
- now = DateTime . now! ( "Etc/UTC" )
78
+ now = DateTime . utc_now ( )
79
79
80
80
parent = "work_orders"
81
81
@@ -109,7 +109,7 @@ defmodule Lightning.PartitionTableServiceTest do
109
109
end
110
110
111
111
test "add_headroom - all" do
112
- now = DateTime . now! ( "Etc/UTC" )
112
+ now = DateTime . utc_now ( )
113
113
114
114
parent = "work_orders"
115
115
@@ -129,7 +129,7 @@ defmodule Lightning.PartitionTableServiceTest do
129
129
end
130
130
131
131
test "add_headroom - parent specified" do
132
- now = DateTime . now! ( "Etc/UTC" )
132
+ now = DateTime . utc_now ( )
133
133
134
134
parent = "work_orders"
135
135
@@ -152,7 +152,7 @@ defmodule Lightning.PartitionTableServiceTest do
152
152
test "remove_empty" do
153
153
parent = "work_orders"
154
154
155
- now = DateTime . now! ( "Etc/UTC" )
155
+ now = DateTime . utc_now ( )
156
156
157
157
drop_range_partitions ( parent )
158
158
@@ -167,7 +167,7 @@ defmodule Lightning.PartitionTableServiceTest do
167
167
168
168
generate_partitions ( - 6 .. 3 , now , parent )
169
169
170
- weeks_ago = Timex . shift ( DateTime . utc_now ( ) , weeks: - 2 )
170
+ weeks_ago = DateTime . add ( DateTime . utc_now ( ) , - 2 * 7 , :day )
171
171
172
172
Service . remove_empty ( parent , weeks_ago )
173
173
0 commit comments