From 146f08513cb70c70dcc6fd0adb580f2ffdf1e737 Mon Sep 17 00:00:00 2001 From: isha Date: Thu, 24 Sep 2026 02:23:15 -0700 Subject: [PATCH] [tests-only][full-ci][k8s] test: run apiSearchContent on k8s deployment (#12959) test: disable redundant k8s 5xx retries for search requests --- .github/workflows/k8s.yml | 2 +- tests/acceptance/TestHelpers/HttpRequestHelper.php | 7 ++++++- tests/acceptance/bootstrap/SearchContext.php | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index e8ed731c8af..21884b9b87c 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -52,7 +52,7 @@ jobs: - suite: apiActivities - suite: apiSearch1 - suite: apiSearch2 - # - suite: apiSearchContent + - suite: apiSearchContent - suite: apiSharingNgShares - suite: apiReshare - suite: apiSharingNgPermissions diff --git a/tests/acceptance/TestHelpers/HttpRequestHelper.php b/tests/acceptance/TestHelpers/HttpRequestHelper.php index f240c0f8bfc..59c4166fc54 100644 --- a/tests/acceptance/TestHelpers/HttpRequestHelper.php +++ b/tests/acceptance/TestHelpers/HttpRequestHelper.php @@ -204,6 +204,10 @@ class HttpRequestHelper { * @param int|null $timeout * @param Client|null $client * @param bool|null $isGivenStep + * @param bool $retryOn5xxForK8s Set to false when the caller already has its own + * retry-on-5xx loop (e.g. SearchContext::searchWithRetry), + * so this generic layer doesn't redundantly burn extra + * time retrying inside every one of the caller's attempts. * * @return ResponseInterface * @@ -223,6 +227,7 @@ class HttpRequestHelper { ?int $timeout = 0, ?Client $client = null, ?bool $isGivenStep = false, + bool $retryOn5xxForK8s = true, ): ResponseInterface { if ((\getenv('DEBUG_ACCEPTANCE_RESPONSES') !== false) || (\getenv('DEBUG_ACCEPTANCE_API_CALLS') !== false)) { $debugResponses = true; @@ -270,7 +275,7 @@ class HttpRequestHelper { $loopAgain = !$sendExceptionHappened && ($response->getStatusCode() === self::HTTP_TOO_EARLY || ($response->getStatusCode() === self::HTTP_CONFLICT && $isGivenStep)) && $sendCount <= $sendRetryLimit; - if (OcisConfigHelper::isK8s()) { + if ($retryOn5xxForK8s && OcisConfigHelper::isK8s()) { $loopAgain = $loopAgain || ($response->getStatusCode() >= HttpResponse::HTTP_INTERNAL_SERVER_ERROR && $sendCount <= $sendRetryLimit && $response->getStatusCode() !== HttpResponse::HTTP_INSUFFICIENT_STORAGE); diff --git a/tests/acceptance/bootstrap/SearchContext.php b/tests/acceptance/bootstrap/SearchContext.php index 44b39fb8a84..92f321d1279 100644 --- a/tests/acceptance/bootstrap/SearchContext.php +++ b/tests/acceptance/bootstrap/SearchContext.php @@ -213,6 +213,9 @@ class SearchContext implements Context { $password, $headers, $body, + // this method's own caller (searchWithRetry) already retries on 5xx, + // so the generic k8s 5xx-retry here would just double up the wait + retryOn5xxForK8s: false, ); }