@@ -27,21 +27,25 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
27
27
block0to1hExt3Ulid := ulid .MustNew (7 , nil )
28
28
block4hto6hExt2Ulid := ulid .MustNew (8 , nil )
29
29
block6hto8hExt2Ulid := ulid .MustNew (9 , nil )
30
- block1hto2hExt_1_ulid := ulid .MustNew (10 , nil )
30
+ block1hto2hExt1UlidCopy := ulid .MustNew (10 , nil )
31
31
block0hto20hExt1Ulid := ulid .MustNew (11 , nil )
32
32
block21hto40hExt1Ulid := ulid .MustNew (12 , nil )
33
- block21hto40hExt1Ulid_copy := ulid .MustNew (13 , nil )
33
+ block21hto40hExt1UlidCopy := ulid .MustNew (13 , nil )
34
34
block0hto45mExt1Ulid := ulid .MustNew (14 , nil )
35
35
block0hto1h30mExt1Ulid := ulid .MustNew (15 , nil )
36
36
blocklast1hExt1Ulid := ulid .MustNew (16 , nil )
37
- blocklast1hExt1Ulid_copy := ulid .MustNew (17 , nil )
37
+ blocklast1hExt1UlidCopy := ulid .MustNew (17 , nil )
38
38
39
39
blocks :=
40
40
map [ulid.ULID ]* metadata.Meta {
41
41
block1hto2hExt1Ulid : {
42
42
BlockMeta : tsdb.BlockMeta {ULID : block1hto2hExt1Ulid , MinTime : 1 * time .Hour .Milliseconds (), MaxTime : 2 * time .Hour .Milliseconds ()},
43
43
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
44
44
},
45
+ block1hto2hExt1UlidCopy : {
46
+ BlockMeta : tsdb.BlockMeta {ULID : block1hto2hExt1UlidCopy , MinTime : 1 * time .Hour .Milliseconds (), MaxTime : 2 * time .Hour .Milliseconds ()},
47
+ Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
48
+ },
45
49
block3hto4hExt1Ulid : {
46
50
BlockMeta : tsdb.BlockMeta {ULID : block3hto4hExt1Ulid , MinTime : 3 * time .Hour .Milliseconds (), MaxTime : 4 * time .Hour .Milliseconds ()},
47
51
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
@@ -74,10 +78,6 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
74
78
BlockMeta : tsdb.BlockMeta {ULID : block6hto8hExt2Ulid , MinTime : 6 * time .Hour .Milliseconds (), MaxTime : 8 * time .Hour .Milliseconds ()},
75
79
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "2" }},
76
80
},
77
- block1hto2hExt_1_ulid : {
78
- BlockMeta : tsdb.BlockMeta {ULID : block1hto2hExt_1_ulid , MinTime : 1 * time .Hour .Milliseconds (), MaxTime : 2 * time .Hour .Milliseconds ()},
79
- Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
80
- },
81
81
block0hto20hExt1Ulid : {
82
82
BlockMeta : tsdb.BlockMeta {ULID : block0hto20hExt1Ulid , MinTime : 0 * time .Hour .Milliseconds (), MaxTime : 20 * time .Hour .Milliseconds ()},
83
83
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
@@ -86,8 +86,8 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
86
86
BlockMeta : tsdb.BlockMeta {ULID : block21hto40hExt1Ulid , MinTime : 21 * time .Hour .Milliseconds (), MaxTime : 40 * time .Hour .Milliseconds ()},
87
87
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
88
88
},
89
- block21hto40hExt1Ulid_copy : {
90
- BlockMeta : tsdb.BlockMeta {ULID : block21hto40hExt1Ulid_copy , MinTime : 21 * time .Hour .Milliseconds (), MaxTime : 40 * time .Hour .Milliseconds ()},
89
+ block21hto40hExt1UlidCopy : {
90
+ BlockMeta : tsdb.BlockMeta {ULID : block21hto40hExt1UlidCopy , MinTime : 21 * time .Hour .Milliseconds (), MaxTime : 40 * time .Hour .Milliseconds ()},
91
91
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
92
92
},
93
93
block0hto45mExt1Ulid : {
@@ -102,8 +102,8 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
102
102
BlockMeta : tsdb.BlockMeta {ULID : blocklast1hExt1Ulid , MinTime : int64 (ulid .Now ()) - 1 * time .Hour .Milliseconds (), MaxTime : int64 (ulid .Now ())},
103
103
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
104
104
},
105
- blocklast1hExt1Ulid_copy : {
106
- BlockMeta : tsdb.BlockMeta {ULID : blocklast1hExt1Ulid_copy , MinTime : int64 (ulid .Now ()) - 1 * time .Hour .Milliseconds (), MaxTime : int64 (ulid .Now ())},
105
+ blocklast1hExt1UlidCopy : {
106
+ BlockMeta : tsdb.BlockMeta {ULID : blocklast1hExt1UlidCopy , MinTime : int64 (ulid .Now ()) - 1 * time .Hour .Milliseconds (), MaxTime : int64 (ulid .Now ())},
107
107
Thanos : metadata.Thanos {Labels : map [string ]string {"external" : "1" }},
108
108
},
109
109
}
@@ -138,17 +138,17 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
138
138
},
139
139
"test oldest min time first" : {
140
140
ranges : []time.Duration {2 * time .Hour , 4 * time .Hour },
141
- blocks : map [ulid.ULID ]* metadata.Meta {block1hto2hExt1Ulid : blocks [block1hto2hExt1Ulid ], block3hto4hExt1Ulid : blocks [block3hto4hExt1Ulid ], block0hto1hExt1Ulid : blocks [block0hto1hExt1Ulid ], block2hto3hExt1Ulid : blocks [block2hto3hExt1Ulid ], block1hto2hExt_1_ulid : blocks [block1hto2hExt_1_ulid ]},
141
+ blocks : map [ulid.ULID ]* metadata.Meta {block1hto2hExt1Ulid : blocks [block1hto2hExt1Ulid ], block3hto4hExt1Ulid : blocks [block3hto4hExt1Ulid ], block0hto1hExt1Ulid : blocks [block0hto1hExt1Ulid ], block2hto3hExt1Ulid : blocks [block2hto3hExt1Ulid ], block1hto2hExt1UlidCopy : blocks [block1hto2hExt1UlidCopy ]},
142
142
expected : [][]ulid.ULID {
143
- {block1hto2hExt1Ulid , block0hto1hExt1Ulid , block1hto2hExt_1_ulid },
143
+ {block1hto2hExt1Ulid , block0hto1hExt1Ulid , block1hto2hExt1UlidCopy },
144
144
{block3hto4hExt1Ulid , block2hto3hExt1Ulid },
145
145
},
146
146
},
147
147
"test overlapping blocks" : {
148
148
ranges : []time.Duration {20 * time .Hour , 40 * time .Hour },
149
- blocks : map [ulid.ULID ]* metadata.Meta {block0hto20hExt1Ulid : blocks [block0hto20hExt1Ulid ], block21hto40hExt1Ulid : blocks [block21hto40hExt1Ulid ], block21hto40hExt1Ulid_copy : blocks [block21hto40hExt1Ulid_copy ]},
149
+ blocks : map [ulid.ULID ]* metadata.Meta {block0hto20hExt1Ulid : blocks [block0hto20hExt1Ulid ], block21hto40hExt1Ulid : blocks [block21hto40hExt1Ulid ], block21hto40hExt1UlidCopy : blocks [block21hto40hExt1UlidCopy ]},
150
150
expected : [][]ulid.ULID {
151
- {block21hto40hExt1Ulid , block21hto40hExt1Ulid_copy },
151
+ {block21hto40hExt1Ulid , block21hto40hExt1UlidCopy },
152
152
},
153
153
},
154
154
"test imperfect maxTime blocks" : {
@@ -160,7 +160,7 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
160
160
},
161
161
"test prematurely created blocks" : {
162
162
ranges : []time.Duration {2 * time .Hour },
163
- blocks : map [ulid.ULID ]* metadata.Meta {blocklast1hExt1Ulid_copy : blocks [blocklast1hExt1Ulid_copy ], blocklast1hExt1Ulid : blocks [blocklast1hExt1Ulid ]},
163
+ blocks : map [ulid.ULID ]* metadata.Meta {blocklast1hExt1UlidCopy : blocks [blocklast1hExt1UlidCopy ], blocklast1hExt1Ulid : blocks [blocklast1hExt1Ulid ]},
164
164
expected : [][]ulid.ULID {},
165
165
},
166
166
}
0 commit comments