Allow retry in query tests
This commit is contained in:
@@ -656,9 +656,12 @@ def test_queries():
|
||||
# If the metric has arguments to use while testing, grab those
|
||||
args = metric.get("test_args", {})
|
||||
print("Testing {} [{}]".format(name, ", ".join(["{}={}".format(key, value) for key, value in args.items()])))
|
||||
# Run the query without the ability to retry.
|
||||
# Run the query with the ability to retry, mostly because the PostgreSQL
|
||||
# docker image restarts during its initialization phase. If the health
|
||||
# check passes during the first phase, the agent will start testing too
|
||||
# early and will break when PostgreSQL restarts.
|
||||
try:
|
||||
res = sample_metric(dbname, name, args, retry=False)
|
||||
res = sample_metric(dbname, name, args, retry=True)
|
||||
except MetricVersionError:
|
||||
print("{} -> Unsupported for this version".format(name))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user