mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
scrape_test: fix send-to-closed-channel bugs (#6849)
Signed-off-by: BurtonQin <bobbqqin@gmail.com>
This commit is contained in:
parent
d276b5fb65
commit
0e51cf65e7
|
@ -432,7 +432,6 @@ func TestScrapeLoopStop(t *testing.T) {
|
||||||
scraper = &testScraper{}
|
scraper = &testScraper{}
|
||||||
app = func() storage.Appender { return appender }
|
app = func() storage.Appender { return appender }
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
sl := newScrapeLoop(context.Background(),
|
sl := newScrapeLoop(context.Background(),
|
||||||
scraper,
|
scraper,
|
||||||
|
@ -498,7 +497,6 @@ func TestScrapeLoopRun(t *testing.T) {
|
||||||
scraper = &testScraper{}
|
scraper = &testScraper{}
|
||||||
app = func() storage.Appender { return &nopAppender{} }
|
app = func() storage.Appender { return &nopAppender{} }
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
sl := newScrapeLoop(ctx,
|
sl := newScrapeLoop(ctx,
|
||||||
|
@ -679,7 +677,6 @@ func TestScrapeLoopRunCreatesStaleMarkersOnFailedScrape(t *testing.T) {
|
||||||
scraper = &testScraper{}
|
scraper = &testScraper{}
|
||||||
app = func() storage.Appender { return appender }
|
app = func() storage.Appender { return appender }
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
sl := newScrapeLoop(ctx,
|
sl := newScrapeLoop(ctx,
|
||||||
|
@ -734,7 +731,6 @@ func TestScrapeLoopRunCreatesStaleMarkersOnParseFailure(t *testing.T) {
|
||||||
app = func() storage.Appender { return appender }
|
app = func() storage.Appender { return appender }
|
||||||
numScrapes = 0
|
numScrapes = 0
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
sl := newScrapeLoop(ctx,
|
sl := newScrapeLoop(ctx,
|
||||||
|
@ -795,7 +791,6 @@ func TestScrapeLoopCache(t *testing.T) {
|
||||||
scraper = &testScraper{}
|
scraper = &testScraper{}
|
||||||
app = func() storage.Appender { return appender }
|
app = func() storage.Appender { return appender }
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
sl := newScrapeLoop(ctx,
|
sl := newScrapeLoop(ctx,
|
||||||
|
@ -872,7 +867,6 @@ func TestScrapeLoopCacheMemoryExhaustionProtection(t *testing.T) {
|
||||||
scraper = &testScraper{}
|
scraper = &testScraper{}
|
||||||
app = func() storage.Appender { return appender }
|
app = func() storage.Appender { return appender }
|
||||||
)
|
)
|
||||||
defer close(signal)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
sl := newScrapeLoop(ctx,
|
sl := newScrapeLoop(ctx,
|
||||||
|
|
Loading…
Reference in a new issue