From 13def94ac5a29cfa99453030054e8be227a36b49 Mon Sep 17 00:00:00 2001 From: mamari90 <130982006+mamari90@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:01:25 +0100 Subject: [PATCH] test timeout --- src/synthetic-monitoring.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/synthetic-monitoring.js b/src/synthetic-monitoring.js index 512c62d..03eae00 100644 --- a/src/synthetic-monitoring.js +++ b/src/synthetic-monitoring.js @@ -207,7 +207,7 @@ function apiResponseElaborator(metricContext){ let durationOk = duration <= metricContext.monitoringConfiguration.durationLimit apiMetrics['duration'] = duration; apiMetrics['success'] = statusCodeOk && durationOk; - apiMetrics['message'] = !statusCodeOk ? `${response.statusText}` : (!durationOk ? `time limit exceeded: ${duration} > ${metricContext.monitoringConfiguration.durationLimit}` : `${response.statusText}`) + apiMetrics['message'] = !statusCodeOk ? `status code not valid: ${response.statusText}` : (!durationOk ? `time limit exceeded: ${duration} > ${metricContext.monitoringConfiguration.durationLimit}` : `${response.statusText}`) apiMetrics['httpStatus'] = response.status apiMetrics['targetStatus'] = statusCodeOk ? 1 : 0 apiMetrics['targetTlsVersion'] = extractTlsVersion(response[TLS_VERSION_KEY]); @@ -263,6 +263,7 @@ function buildRequest(monitoringConfiguration){ validateStatus: function (status) { return true; //every status code should be treated as a valid code (it will be checked later) } + timeout: 30 } if (monitoringConfiguration.headers) {