mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 14:27:27 -08:00
storage/remote/intern_test.go: Fix linting errors
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
This commit is contained in:
parent
b97a1bb7d1
commit
21a2e8c320
|
@ -33,7 +33,7 @@ func TestIntern(t *testing.T) {
|
||||||
interned, ok := interner.pool[testString]
|
interned, ok := interner.pool[testString]
|
||||||
|
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs.Load()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIntern_MultiRef(t *testing.T) {
|
func TestIntern_MultiRef(t *testing.T) {
|
||||||
|
@ -44,13 +44,13 @@ func TestIntern_MultiRef(t *testing.T) {
|
||||||
interned, ok := interner.pool[testString]
|
interned, ok := interner.pool[testString]
|
||||||
|
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs.Load()))
|
||||||
|
|
||||||
interner.intern(testString)
|
interner.intern(testString)
|
||||||
interned, ok = interner.pool[testString]
|
interned, ok = interner.pool[testString]
|
||||||
|
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 2, fmt.Sprintf("expected refs to be 2 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 2, fmt.Sprintf("expected refs to be 2 but it was %d", interned.refs.Load()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIntern_DeleteRef(t *testing.T) {
|
func TestIntern_DeleteRef(t *testing.T) {
|
||||||
|
@ -61,7 +61,7 @@ func TestIntern_DeleteRef(t *testing.T) {
|
||||||
interned, ok := interner.pool[testString]
|
interned, ok := interner.pool[testString]
|
||||||
|
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs.Load()))
|
||||||
|
|
||||||
interner.release(testString)
|
interner.release(testString)
|
||||||
_, ok = interner.pool[testString]
|
_, ok = interner.pool[testString]
|
||||||
|
@ -75,7 +75,7 @@ func TestIntern_MultiRef_Concurrent(t *testing.T) {
|
||||||
interner.intern(testString)
|
interner.intern(testString)
|
||||||
interned, ok := interner.pool[testString]
|
interned, ok := interner.pool[testString]
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs.Load()))
|
||||||
|
|
||||||
go interner.release(testString)
|
go interner.release(testString)
|
||||||
|
|
||||||
|
@ -87,5 +87,5 @@ func TestIntern_MultiRef_Concurrent(t *testing.T) {
|
||||||
interned, ok = interner.pool[testString]
|
interned, ok = interner.pool[testString]
|
||||||
interner.mtx.RUnlock()
|
interner.mtx.RUnlock()
|
||||||
testutil.Equals(t, true, ok)
|
testutil.Equals(t, true, ok)
|
||||||
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs))
|
testutil.Assert(t, interned.refs.Load() == 1, fmt.Sprintf("expected refs to be 1 but it was %d", interned.refs.Load()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue