File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 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) {
6565 }
6666}
6767
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 ) {
7169 db , mock , err := sqlmock .New ()
7270 if err != nil {
7371 t .Fatalf ("Error opening a stub db connection: %s" , err )
@@ -101,7 +99,12 @@ func xTestPgNanCollector(t *testing.T) {
10199 convey .Convey ("Metrics comparison" , t , func () {
102100 for _ , expect := range expected {
103101 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+ }
105108 }
106109 })
107110 if err := mock .ExpectationsWereMet (); err != nil {
You can’t perform that action at this time.
0 commit comments