diff --git a/cmd/e2e-test/carbon-clickhouse.go b/cmd/e2e-test/carbon-clickhouse.go index cc2934ad4..01d684a68 100644 --- a/cmd/e2e-test/carbon-clickhouse.go +++ b/cmd/e2e-test/carbon-clickhouse.go @@ -26,7 +26,7 @@ type CarbonClickhouse struct { storeDir string `toml:"-"` } -func (c *CarbonClickhouse) Start(testDir, clickhouseURL, clickhouseContainer string) (string, error) { +func (c *CarbonClickhouse) Start(testDir, clickhouseURL string) (string, error) { if len(c.Version) == 0 { c.Version = "0.11.4" } @@ -89,7 +89,7 @@ func (c *CarbonClickhouse) Start(testDir, clickhouseURL, clickhouseContainer str "-v", "/etc/timezone:/etc/timezone:ro", "-v", "/etc/localtime:/etc/localtime:ro", "-e", "TZ=" + tz, - "--link", clickhouseContainer, + "--network", DockerNetwork, } cchStart = append(cchStart, c.DockerImage+":"+c.Version) diff --git a/cmd/e2e-test/clickhouse.go b/cmd/e2e-test/clickhouse.go index 126650d90..6bbd9a833 100644 --- a/cmd/e2e-test/clickhouse.go +++ b/cmd/e2e-test/clickhouse.go @@ -86,6 +86,7 @@ func (c *Clickhouse) Start() (string, error) { "-v", c.Dir + "/users.xml:/etc/clickhouse-server/users.xml", "-v", c.Dir + "/rollup.xml:/etc/clickhouse-server/config.d/rollup.xml", "-v", c.Dir + "/init.sql:/docker-entrypoint-initdb.d/init.sql", + "--network", DockerNetwork, } if c.TZ != "" { chStart = append(chStart, "-e", "TZ="+c.TZ) diff --git a/cmd/e2e-test/container.go b/cmd/e2e-test/container.go index 5640e25e8..8ed5443fe 100644 --- a/cmd/e2e-test/container.go +++ b/cmd/e2e-test/container.go @@ -5,7 +5,10 @@ import ( "strings" ) -var DockerBinary string +var ( + DockerBinary string + DockerNetwork string = "graphite-ch-test" +) func imageDelete(image, version string) (bool, string) { if len(DockerBinary) == 0 { diff --git a/cmd/e2e-test/e2etesting.go b/cmd/e2e-test/e2etesting.go index a9c866a59..09534f6b7 100644 --- a/cmd/e2e-test/e2etesting.go +++ b/cmd/e2e-test/e2etesting.go @@ -433,7 +433,7 @@ func testGraphiteClickhouse(test *TestSchema, clickhouse *Clickhouse, testDir, r return } - out, err := test.Cch.Start(testDir, "http://"+clickhouse.Container()+":8123", clickhouse.Container()) + out, err := test.Cch.Start(testDir, "http://"+clickhouse.Container()+":8123") if err != nil { logger.Error("starting carbon-clickhouse", zap.String("config", test.name), diff --git a/cmd/e2e-test/main.go b/cmd/e2e-test/main.go index b78fdae58..1e03b35b5 100644 --- a/cmd/e2e-test/main.go +++ b/cmd/e2e-test/main.go @@ -145,6 +145,18 @@ func main() { verifyCount := 0 verifyFailed := 0 + _, err = cmdExec(DockerBinary, "network", "exists", DockerNetwork) + if err != nil { + out, err := cmdExec(DockerBinary, "network", "create", DockerNetwork) + if err != nil { + logger.Error("failed to create network", + zap.Error(err), + zap.String("out", out), + ) + os.Exit(1) + } + } + for chVersion := range chVersions { ch := chVersions[chVersion] if exist, out := containerExist(ClickhouseContainerName); exist { diff --git a/cmd/e2e-test/utils.go b/cmd/e2e-test/utils.go index 06ab7d0f9..9b43dd12d 100644 --- a/cmd/e2e-test/utils.go +++ b/cmd/e2e-test/utils.go @@ -1 +1,10 @@ package main + +import "os/exec" + +func cmdExec(programm string, args ...string) (string, error) { + cmd := exec.Command(programm, args...) + out, err := cmd.CombinedOutput() + + return string(out), err +} diff --git a/tests/clickhouse/rollup/init.sql b/tests/clickhouse/rollup/init.sql index 75550225f..1b624e5d1 100644 --- a/tests/clickhouse/rollup/init.sql +++ b/tests/clickhouse/rollup/init.sql @@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS default.graphite_reverse ( Date Date, Timestamp UInt32 ) ENGINE = GraphiteMergeTree('graphite_rollup') -PARTITION BY toYYYYMM(Date) +PARTITION BY Date ORDER BY (Path, Time); CREATE TABLE IF NOT EXISTS default.graphite ( @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS default.graphite ( Date Date, Timestamp UInt32 ) ENGINE = GraphiteMergeTree('graphite_rollup') -PARTITION BY toYYYYMM(Date) +PARTITION BY Date ORDER BY (Path, Time); CREATE TABLE IF NOT EXISTS default.graphite_index ( @@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS default.graphite_index ( Path String, Version UInt32 ) ENGINE = ReplacingMergeTree(Version) -PARTITION BY toYYYYMM(Date) +PARTITION BY Date ORDER BY (Level, Path, Date); CREATE TABLE IF NOT EXISTS default.graphite_tags ( @@ -34,5 +34,5 @@ CREATE TABLE IF NOT EXISTS default.graphite_tags ( Tags Array(String), Version UInt32 ) ENGINE = ReplacingMergeTree(Version) -PARTITION BY toYYYYMM(Date) +PARTITION BY Date ORDER BY (Tag1, Path, Date); diff --git a/tests/metrics/test.toml b/tests/metrics/test.toml index be6ef7a77..b8a54c436 100644 --- a/tests/metrics/test.toml +++ b/tests/metrics/test.toml @@ -69,10 +69,19 @@ error_regexp = "^504: Storage read timeout" name = "test.long" points = [ {value = 3.0, time = "rnow-30"}, {value = 0.0, time = "rnow-20"}, {value = 1.0, time = "rnow-10"}, {value = 2.0, time = "rnow"}, - {value = 3.0, time = "rnow-14400"}, {value = 3.0, time = "rnow-3600"}, {value = 3.0, time = "rnow-3590"}, {value = 3.0, time = "rnow-3580"}, {value = 3.0, time = "rnow-3570"}, {value = 3.0, time = "rnow-3560"}, {value = 3.0, time = "rnow-3550"}, {value = 3.0, time = "rnow-3540"}, {value = 3.0, time = "rnow-3530"}, - {value = 3.0, time = "rnow-3520"}, {value = 3.0, time = "rnow-3510"}, {value = 3.0, time = "rnow-3500"}, {value = 3.0, time = "rnow-3490"} + {value = 3.0, time = "rnow-3520"}, {value = 3.0, time = "rnow-3510"}, {value = 3.0, time = "rnow-3500"}, {value = 3.0, time = "rnow-3490"}, + {value = 3.0, time = "rnow-14200"}, {value = 3.0, time = "rnow-14400"}, + {value = 3.0, time = "rnow-86200"}, {value = 3.0, time = "rnow-86400"}, + {value = 3.0, time = "rnow-172600"}, {value = 3.0, time = "rnow-172800"}, + {value = 2.0, time = "rnow-345200"}, {value = 2.0, time = "rnow-345210"}, {value = 2.0, time = "rnow-345220"}, {value = 2.0, time = "rnow-345230"}, {value = 2.0, time = "rnow-345240"}, {value = 2.0, time = "rnow-345250"}, {value = 2.0, time = "rnow-345260"}, {value = 2.0, time = "rnow-345270"}, {value = 2.0, time = "rnow-345280"}, {value = 2.0, time = "rnow-345290"}, {value = 2.0, time = "rnow-345300"}, {value = 2.0, time = "rnow-345310"}, {value = 2.0, time = "rnow-345320"}, {value = 2.0, time = "rnow-345330"}, {value = 2.0, time = "rnow-345340"}, {value = 2.0, time = "rnow-345350"}, {value = 2.0, time = "rnow-345360"}, {value = 2.0, time = "rnow-345370"}, {value = 2.0, time = "rnow-345380"}, {value = 2.0, time = "rnow-345390"}, {value = 2.0, time = "rnow-345400"}, {value = 2.0, time = "rnow-345410"}, {value = 2.0, time = "rnow-345420"}, {value = 2.0, time = "rnow-345430"}, {value = 2.0, time = "rnow-345440"}, {value = 2.0, time = "rnow-345450"}, {value = 2.0, time = "rnow-345460"}, {value = 2.0, time = "rnow-345470"}, {value = 2.0, time = "rnow-345480"}, {value = 2.0, time = "rnow-345490"}, {value = 2.0, time = "rnow-345500"}, {value = 2.0, time = "rnow-345510"}, {value = 2.0, time = "rnow-345520"}, {value = 2.0, time = "rnow-345530"}, {value = 2.0, time = "rnow-345540"}, {value = 2.0, time = "rnow-345550"}, {value = 2.0, time = "rnow-345560"}, {value = 2.0, time = "rnow-345570"}, {value = 2.0, time = "rnow-345580"}, {value = 2.0, time = "rnow-345590"}, {value = 2.0, time = "rnow-345600"}, + {value = 2.0, time = "rnow-431800"}, {value = 2.0, time = "rnow-431810"}, {value = 2.0, time = "rnow-431820"}, {value = 2.0, time = "rnow-431830"}, {value = 2.0, time = "rnow-431840"}, {value = 2.0, time = "rnow-431850"}, {value = 2.0, time = "rnow-431860"}, {value = 2.0, time = "rnow-431870"}, {value = 2.0, time = "rnow-431880"}, {value = 2.0, time = "rnow-431890"}, {value = 2.0, time = "rnow-431900"}, {value = 2.0, time = "rnow-431910"}, {value = 2.0, time = "rnow-431920"}, {value = 2.0, time = "rnow-431930"}, {value = 2.0, time = "rnow-431940"}, {value = 2.0, time = "rnow-431950"}, {value = 2.0, time = "rnow-431960"}, {value = 2.0, time = "rnow-431970"}, {value = 2.0, time = "rnow-431980"}, {value = 2.0, time = "rnow-431990"}, {value = 2.0, time = "rnow-432000"}, {value = 2.0, time = "rnow-432010"}, {value = 2.0, time = "rnow-432020"}, {value = 2.0, time = "rnow-432030"}, {value = 2.0, time = "rnow-432040"}, {value = 2.0, time = "rnow-432050"}, {value = 2.0, time = "rnow-432060"}, {value = 2.0, time = "rnow-432070"}, {value = 2.0, time = "rnow-432080"}, {value = 2.0, time = "rnow-432090"}, {value = 2.0, time = "rnow-432100"}, {value = 2.0, time = "rnow-432110"}, {value = 2.0, time = "rnow-432120"}, {value = 2.0, time = "rnow-432130"}, {value = 2.0, time = "rnow-432140"}, {value = 2.0, time = "rnow-432150"}, {value = 2.0, time = "rnow-432160"}, {value = 2.0, time = "rnow-432170"}, {value = 2.0, time = "rnow-432180"}, {value = 2.0, time = "rnow-432190"}, {value = 2.0, time = "rnow-432200"}, + {value = 2.0, time = "rnow-518000"}, {value = 2.0, time = "rnow-518010"}, {value = 2.0, time = "rnow-518020"}, {value = 2.0, time = "rnow-518030"}, {value = 2.0, time = "rnow-518040"}, {value = 2.0, time = "rnow-518050"}, {value = 2.0, time = "rnow-518060"}, {value = 2.0, time = "rnow-518070"}, {value = 2.0, time = "rnow-518080"}, {value = 2.0, time = "rnow-518090"}, {value = 2.0, time = "rnow-518100"}, {value = 2.0, time = "rnow-518110"}, {value = 2.0, time = "rnow-518120"}, {value = 2.0, time = "rnow-518130"}, {value = 2.0, time = "rnow-518140"}, {value = 2.0, time = "rnow-518150"}, {value = 2.0, time = "rnow-518160"}, {value = 2.0, time = "rnow-518170"}, {value = 2.0, time = "rnow-518180"}, {value = 2.0, time = "rnow-518190"}, {value = 2.0, time = "rnow-518200"}, {value = 2.0, time = "rnow-518210"}, {value = 2.0, time = "rnow-518220"}, {value = 2.0, time = "rnow-518230"}, {value = 2.0, time = "rnow-518240"}, {value = 2.0, time = "rnow-518250"}, {value = 2.0, time = "rnow-518260"}, {value = 2.0, time = "rnow-518270"}, {value = 2.0, time = "rnow-518280"}, {value = 2.0, time = "rnow-518290"}, {value = 2.0, time = "rnow-518300"}, {value = 2.0, time = "rnow-518310"}, {value = 2.0, time = "rnow-518320"}, {value = 2.0, time = "rnow-518330"}, {value = 2.0, time = "rnow-518340"}, {value = 2.0, time = "rnow-518350"}, {value = 2.0, time = "rnow-518360"}, {value = 2.0, time = "rnow-518370"}, {value = 2.0, time = "rnow-518380"}, {value = 2.0, time = "rnow-518390"}, {value = 2.0, time = "rnow-518400"}, + {value = 3.0, time = "rnow-604400"}, {value = 3.0, time = "rnow-604410"}, {value = 3.0, time = "rnow-604420"}, {value = 3.0, time = "rnow-604430"}, {value = 3.0, time = "rnow-604440"}, {value = 3.0, time = "rnow-604450"}, {value = 3.0, time = "rnow-604460"}, {value = 3.0, time = "rnow-604470"}, {value = 3.0, time = "rnow-604480"}, {value = 3.0, time = "rnow-604490"}, {value = 3.0, time = "rnow-604500"}, {value = 3.0, time = "rnow-604510"}, {value = 3.0, time = "rnow-604520"}, {value = 3.0, time = "rnow-604530"}, {value = 3.0, time = "rnow-604540"}, {value = 3.0, time = "rnow-604550"}, {value = 3.0, time = "rnow-604560"}, {value = 3.0, time = "rnow-604570"}, {value = 3.0, time = "rnow-604580"}, {value = 3.0, time = "rnow-604590"}, {value = 3.0, time = "rnow-604600"}, {value = 3.0, time = "rnow-604610"}, {value = 3.0, time = "rnow-604620"}, {value = 3.0, time = "rnow-604630"}, {value = 3.0, time = "rnow-604640"}, {value = 3.0, time = "rnow-604650"}, {value = 3.0, time = "rnow-604660"}, {value = 3.0, time = "rnow-604670"}, {value = 3.0, time = "rnow-604680"}, {value = 3.0, time = "rnow-604690"}, {value = 3.0, time = "rnow-604700"}, {value = 3.0, time = "rnow-604710"}, {value = 3.0, time = "rnow-604720"}, {value = 3.0, time = "rnow-604730"}, {value = 3.0, time = "rnow-604740"}, {value = 3.0, time = "rnow-604750"}, {value = 3.0, time = "rnow-604760"}, {value = 3.0, time = "rnow-604770"}, {value = 3.0, time = "rnow-604780"}, {value = 3.0, time = "rnow-604790"}, {value = 3.0, time = "rnow-604800"}, + {value = 2.0, time = "rnow-690800"}, {value = 2.0, time = "rnow-690810"}, {value = 2.0, time = "rnow-690820"}, {value = 2.0, time = "rnow-690830"}, {value = 2.0, time = "rnow-690840"}, {value = 2.0, time = "rnow-690850"}, {value = 2.0, time = "rnow-690860"}, {value = 2.0, time = "rnow-690870"}, {value = 2.0, time = "rnow-690880"}, {value = 2.0, time = "rnow-690890"}, {value = 2.0, time = "rnow-690900"}, {value = 2.0, time = "rnow-690910"}, {value = 2.0, time = "rnow-690920"}, {value = 2.0, time = "rnow-690930"}, {value = 2.0, time = "rnow-690940"}, {value = 2.0, time = "rnow-690950"}, {value = 2.0, time = "rnow-690960"}, {value = 2.0, time = "rnow-690970"}, {value = 2.0, time = "rnow-690980"}, {value = 2.0, time = "rnow-690990"}, {value = 2.0, time = "rnow-691000"}, {value = 2.0, time = "rnow-691010"}, {value = 2.0, time = "rnow-691020"}, {value = 2.0, time = "rnow-691030"}, {value = 2.0, time = "rnow-691040"}, {value = 2.0, time = "rnow-691050"}, {value = 2.0, time = "rnow-691060"}, {value = 2.0, time = "rnow-691070"}, {value = 2.0, time = "rnow-691080"}, {value = 2.0, time = "rnow-691090"}, {value = 2.0, time = "rnow-691100"}, {value = 2.0, time = "rnow-691110"}, {value = 2.0, time = "rnow-691120"}, {value = 2.0, time = "rnow-691130"}, {value = 2.0, time = "rnow-691140"}, {value = 2.0, time = "rnow-691150"}, {value = 2.0, time = "rnow-691160"}, {value = 2.0, time = "rnow-691170"}, {value = 2.0, time = "rnow-691180"}, {value = 2.0, time = "rnow-691190"}, {value = 2.0, time = "rnow-691200"}, + {value = 2.0, time = "rnow-777200"}, {value = 2.0, time = "rnow-777210"}, {value = 2.0, time = "rnow-777220"}, {value = 2.0, time = "rnow-777230"}, {value = 2.0, time = "rnow-777240"}, {value = 2.0, time = "rnow-777250"}, {value = 2.0, time = "rnow-777260"}, {value = 2.0, time = "rnow-777270"}, {value = 2.0, time = "rnow-777280"}, {value = 2.0, time = "rnow-777290"}, {value = 2.0, time = "rnow-777300"}, {value = 2.0, time = "rnow-777310"}, {value = 2.0, time = "rnow-777320"}, {value = 2.0, time = "rnow-777330"}, {value = 2.0, time = "rnow-777340"}, {value = 2.0, time = "rnow-777350"}, {value = 2.0, time = "rnow-777360"}, {value = 2.0, time = "rnow-777370"}, {value = 2.0, time = "rnow-777380"}, {value = 2.0, time = "rnow-777390"}, {value = 2.0, time = "rnow-777400"}, {value = 2.0, time = "rnow-777410"}, {value = 2.0, time = "rnow-777420"}, {value = 2.0, time = "rnow-777430"}, {value = 2.0, time = "rnow-777440"}, {value = 2.0, time = "rnow-777450"}, {value = 2.0, time = "rnow-777460"}, {value = 2.0, time = "rnow-777470"}, {value = 2.0, time = "rnow-777480"}, {value = 2.0, time = "rnow-777490"}, {value = 2.0, time = "rnow-777500"}, {value = 2.0, time = "rnow-777510"}, {value = 2.0, time = "rnow-777520"}, {value = 2.0, time = "rnow-777530"}, {value = 2.0, time = "rnow-777540"}, {value = 2.0, time = "rnow-777550"}, {value = 2.0, time = "rnow-777560"}, {value = 2.0, time = "rnow-777570"}, {value = 2.0, time = "rnow-777580"}, {value = 2.0, time = "rnow-777590"}, {value = 2.0, time = "rnow-777600"}, + {value = 3.0, time = "rnow-863800"}, {value = 3.0, time = "rnow-864000"} ] [[test.render_checks]] @@ -93,7 +102,7 @@ values = [1.0, 2.0] # Check addional queryparam (storage read limit) [[test.render_checks]] -from = "rnow-14200" +from = "rnow-21600" until = "rnow" targets = [ "test.long" ] timeout = "5s" @@ -110,8 +119,8 @@ error_regexp = "^504: Storage read timeout" # Check addional queryparam (storage read limit) [[test.render_checks]] -from = "rnow-360000" +from = "rnow-864000" until = "rnow" targets = [ "test.long" ] -timeout = "5s" +timeout = "40s" error_regexp = "^403: Storage read limit for memory"