From ad4f71e6ed50070d85e678f94c6ef1bded485ca5 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Tue, 9 Jul 2024 07:27:20 -0400 Subject: [PATCH] [Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777) (cherry picked from commit 834f8fdb375d0c7eef0de974ae5c0f0c0f19b60a) --- x-pack/test/fleet_cypress/artifact_manager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/test/fleet_cypress/artifact_manager.ts b/x-pack/test/fleet_cypress/artifact_manager.ts index 0fe6609f28efc..23efabe2d976a 100644 --- a/x-pack/test/fleet_cypress/artifact_manager.ts +++ b/x-pack/test/fleet_cypress/artifact_manager.ts @@ -15,6 +15,10 @@ export async function getLatestVersion(): Promise { return pRetry(() => axios('https://artifacts-api.elastic.co/v1/versions'), { maxRetryTime: 60 * 1000, // 1 minute }) - .then((response) => last(response.data.versions as string[]) || DEFAULT_VERSION) + .then( + (response) => + last((response.data.versions as string[]).filter((v) => v.includes('-SNAPSHOT'))) || + DEFAULT_VERSION + ) .catch(() => DEFAULT_VERSION); }