Deference channel

The defer close statement was causing issues in CI

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd) 2022-01-24 16:41:30 +00:00
parent a07ef4c194
commit cdb6baddda

View File

@ -75,7 +75,6 @@ func Test_Collect_CollectsTheNumberOfReplicasOfAService(t *testing.T) {
exporter.services = []types.FunctionStatus{expectedService}
ch := make(chan prometheus.Metric)
defer close(ch)
go exporter.Collect(ch)
@ -88,4 +87,6 @@ func Test_Collect_CollectsTheNumberOfReplicasOfAService(t *testing.T) {
if expectedReplicas != result.value {
t.Errorf("Want %f, got %f", expectedReplicas, result.value)
}
ch = nil
}