File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,7 @@ func TestPgXidCollector(t *testing.T) {
65
65
}
66
66
}
67
67
68
- // This test is turned off for now
69
- // Because convey cannot compare NaN
70
- func xTestPgNanCollector (t * testing.T ) {
68
+ func TestPgNanCollector (t * testing.T ) {
71
69
db , mock , err := sqlmock .New ()
72
70
if err != nil {
73
71
t .Fatalf ("Error opening a stub db connection: %s" , err )
@@ -101,7 +99,12 @@ func xTestPgNanCollector(t *testing.T) {
101
99
convey .Convey ("Metrics comparison" , t , func () {
102
100
for _ , expect := range expected {
103
101
m := readMetric (<- ch )
104
- convey .So (expect , convey .ShouldResemble , m )
102
+ if math .IsNaN (expect .value ) {
103
+ // Assume the rest of it looks fine since the above test should properly exercise it
104
+ convey .So (math .IsNaN (m .value ), convey .ShouldBeTrue )
105
+ } else {
106
+ convey .So (expect , convey .ShouldResemble , m )
107
+ }
105
108
}
106
109
})
107
110
if err := mock .ExpectationsWereMet (); err != nil {
You can’t perform that action at this time.
0 commit comments