From 0e51cf65e78043fddd8ae8a8ea611b7f0f9ce39d Mon Sep 17 00:00:00 2001 From: Boqin Qin Date: Thu, 20 Feb 2020 21:40:25 +0800 Subject: [PATCH] scrape_test: fix send-to-closed-channel bugs (#6849) Signed-off-by: BurtonQin --- scrape/scrape_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index f0009f29e..9c9fe9e45 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -432,7 +432,6 @@ func TestScrapeLoopStop(t *testing.T) { scraper = &testScraper{} app = func() storage.Appender { return appender } ) - defer close(signal) sl := newScrapeLoop(context.Background(), scraper, @@ -498,7 +497,6 @@ func TestScrapeLoopRun(t *testing.T) { scraper = &testScraper{} app = func() storage.Appender { return &nopAppender{} } ) - defer close(signal) ctx, cancel := context.WithCancel(context.Background()) sl := newScrapeLoop(ctx, @@ -679,7 +677,6 @@ func TestScrapeLoopRunCreatesStaleMarkersOnFailedScrape(t *testing.T) { scraper = &testScraper{} app = func() storage.Appender { return appender } ) - defer close(signal) ctx, cancel := context.WithCancel(context.Background()) sl := newScrapeLoop(ctx, @@ -734,7 +731,6 @@ func TestScrapeLoopRunCreatesStaleMarkersOnParseFailure(t *testing.T) { app = func() storage.Appender { return appender } numScrapes = 0 ) - defer close(signal) ctx, cancel := context.WithCancel(context.Background()) sl := newScrapeLoop(ctx, @@ -795,7 +791,6 @@ func TestScrapeLoopCache(t *testing.T) { scraper = &testScraper{} app = func() storage.Appender { return appender } ) - defer close(signal) ctx, cancel := context.WithCancel(context.Background()) sl := newScrapeLoop(ctx, @@ -872,7 +867,6 @@ func TestScrapeLoopCacheMemoryExhaustionProtection(t *testing.T) { scraper = &testScraper{} app = func() storage.Appender { return appender } ) - defer close(signal) ctx, cancel := context.WithCancel(context.Background()) sl := newScrapeLoop(ctx,