mi: make timeout configurable for build functions (#2377)

This commit is contained in:
Jan-Otto Kröpke
2026-03-30 18:32:58 +02:00
committed by GitHub
parent 792ef67c4e
commit 43f83573ef
75 changed files with 322 additions and 143 deletions

View File

@@ -303,7 +303,7 @@ func (cr carriageReturnFilteringReader) Read(p []byte) (int, error) {
}
// Collect implements the Collector interface.
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
func (c *Collector) Collect(ch chan<- prometheus.Metric, _ time.Duration) error {
mTimes := map[string]time.Time{}
// Create empty metricFamily slice here and append parsedFamilies to it inside the loop.

View File

@@ -53,7 +53,7 @@ func TestMultipleDirectories(t *testing.T) {
errCh := make(chan error, 1)
go func() {
errCh <- textFileCollector.Collect(metrics)
errCh <- textFileCollector.Collect(metrics, 0)
close(metrics)
}()
@@ -91,7 +91,7 @@ func TestDuplicateFileName(t *testing.T) {
errCh := make(chan error, 1)
go func() {
errCh <- textFileCollector.Collect(metrics)
errCh <- textFileCollector.Collect(metrics, 0)
close(metrics)
}()