From e7cee1b5ba019e6b0eb7c18f99a0d2f9118ff5db Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 12 Sep 2018 17:56:53 +0200 Subject: [PATCH] Remove tests redundant with TestTargetUpdatesOrder Signed-off-by: Simon Pasquier --- discovery/manager_test.go | 139 -------------------------------------- 1 file changed, 139 deletions(-) diff --git a/discovery/manager_test.go b/discovery/manager_test.go index 8dc28b9451..d58f1643fc 100644 --- a/discovery/manager_test.go +++ b/discovery/manager_test.go @@ -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 {