-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PMM-3473 Fix panic.
- Loading branch information
Anton Kucherov
authored
Jun 10, 2019
1 parent
0dcd9d7
commit b090789
Showing
3 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package mongod | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestReplStatsExportShouldNotPanic(t *testing.T) { | ||
rs := &ReplStats{} | ||
ch := make(chan prometheus.Metric) | ||
f := func() { rs.Export(ch) } | ||
|
||
assert.NotPanics(t, f, "nil pointer in ReplStats") | ||
} | ||
|
||
func TestPreloadStatsExportShouldNotPanic(t *testing.T) { | ||
ps := &PreloadStats{} | ||
ch := make(chan prometheus.Metric) | ||
f := func() { ps.Export(ch) } | ||
|
||
assert.NotPanics(t, f, "nil pointer in PreloadStats") | ||
} |