mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remove tests redundant with TestTargetUpdatesOrder
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
7dc3f11306
commit
e7cee1b5ba
|
@ -1004,145 +1004,6 @@ func TestCoordinationWithReceiver(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "The receiver gets an update when a target group is gone",
|
|
||||||
providers: map[string]Discoverer{
|
|
||||||
"mock1": newMockDiscoveryProvider(
|
|
||||||
update{
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
update{
|
|
||||||
interval: 2 * updateDelay,
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
expected: []expect{
|
|
||||||
{
|
|
||||||
tgs: map[string][]*targetgroup.Group{
|
|
||||||
"mock1": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tgs: map[string][]*targetgroup.Group{
|
|
||||||
"mock1": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "The receiver gets merged updates",
|
|
||||||
providers: map[string]Discoverer{
|
|
||||||
"mock1": newMockDiscoveryProvider(
|
|
||||||
// This update should never be seen by the receiver because
|
|
||||||
// it is overwritten by the next one.
|
|
||||||
update{
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "0"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
update{
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
|
||||||
expected: []expect{
|
|
||||||
{
|
|
||||||
tgs: map[string][]*targetgroup.Group{
|
|
||||||
"mock1": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Discovery with multiple providers",
|
|
||||||
providers: map[string]Discoverer{
|
|
||||||
"mock1": newMockDiscoveryProvider(
|
|
||||||
// This update is available in the first receive.
|
|
||||||
update{
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
),
|
|
||||||
"mock2": newMockDiscoveryProvider(
|
|
||||||
// This update should only arrive after the receiver has read from the channel once.
|
|
||||||
update{
|
|
||||||
interval: 2 * updateDelay,
|
|
||||||
targetGroups: []targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg2",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "2"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
expected: []expect{
|
|
||||||
{
|
|
||||||
tgs: map[string][]*targetgroup.Group{
|
|
||||||
"mock1": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
delay: 1 * updateDelay,
|
|
||||||
tgs: map[string][]*targetgroup.Group{
|
|
||||||
"mock1": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg1",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "1"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"mock2": []*targetgroup.Group{
|
|
||||||
{
|
|
||||||
Source: "tg2",
|
|
||||||
Targets: []model.LabelSet{{"__instance__": "2"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|
Loading…
Reference in a new issue