Skip to content

Commit

Permalink
add test for large mean aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
neonstalwart committed Apr 22, 2015
1 parent 31264ac commit bd52c3b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/influxd/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"log"
"math"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -397,6 +398,7 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent

yesterday := time.Now().Add(-1 * time.Hour * 24).UTC()
now := time.Now().UTC()
maxFloat64, _ := json.Marshal(math.MaxFloat64)

// Start by ensuring database and retention policy exist.
createDatabase(t, testName, nodes, database)
Expand Down Expand Up @@ -568,6 +570,17 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent
},

// Aggregations
{
reset: true,
name: "large mean",
write: `{"database" : "%DB%", "retentionPolicy" : "%RP%", "points": [
{"name": "cpu", "timestamp": "2015-04-20T14:27:40Z", "fields": {"value": ` + string(maxFloat64) + `}},
{"name": "cpu", "timestamp": "2015-04-20T14:27:41Z", "fields": {"value": ` + string(maxFloat64) + `}}
]}`,
query: `SELECT mean(value) FROM cpu`,
queryDb: "%DB%",
expected: `{"results":[{"series":[{"name":"cpu","columns":["time","mean"],"values":[["1970-01-01T00:00:00Z",` + string(maxFloat64) + `]]}]}]}`,
},
{
reset: true,
name: "aggregations",
Expand Down

0 comments on commit bd52c3b

Please sign in to comment.