Remove runtime-dependent test.
Success of this test was runtime dependent and did not validate the implementation logic itself.
This commit is contained in:
parent
dd33f764bd
commit
89773a6194
|
@ -14,7 +14,6 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -247,25 +246,6 @@ func BenchmarkMetricToFastFingerprintTriple(b *testing.B) {
|
||||||
benchmarkMetricToFastFingerprint(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676)
|
benchmarkMetricToFastFingerprint(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEmptyLabelSignature(t *testing.T) {
|
|
||||||
input := []map[string]string{nil, {}}
|
|
||||||
|
|
||||||
var ms runtime.MemStats
|
|
||||||
runtime.ReadMemStats(&ms)
|
|
||||||
|
|
||||||
alloc := ms.Alloc
|
|
||||||
|
|
||||||
for _, labels := range input {
|
|
||||||
LabelsToSignature(labels)
|
|
||||||
}
|
|
||||||
|
|
||||||
runtime.ReadMemStats(&ms)
|
|
||||||
|
|
||||||
if got := ms.Alloc; alloc != got {
|
|
||||||
t.Fatal("expected LabelsToSignature with empty labels not to perform allocations")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func benchmarkMetricToFastFingerprintConc(b *testing.B, m Metric, e Fingerprint, concLevel int) {
|
func benchmarkMetricToFastFingerprintConc(b *testing.B, m Metric, e Fingerprint, concLevel int) {
|
||||||
var start, end sync.WaitGroup
|
var start, end sync.WaitGroup
|
||||||
start.Add(1)
|
start.Add(1)
|
||||||
|
|
Loading…
Reference in New Issue