From 3aafceab403294b2c04d2e10aad8d9e36fd0222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 3 Feb 2025 11:38:36 +0100 Subject: [PATCH] Improve CI/CD flaky tests --- .github/workflows/tests.yml | 3 +++ app/controllers/api/functions.php | 12 ------------ app/controllers/general.php | 2 +- .../Functions/Http/Functions/ListFunctions.php | 2 +- src/Executor/Executor.php | 2 +- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a31c128541..b0fceae8ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -168,6 +168,9 @@ jobs: export _APP_DATABASE_SHARED_TABLES= export _APP_DATABASE_SHARED_TABLES_V1= fi + + echo 'Sleep 1 minute, as temporary fix for v4rc executor startup (image pulling)' + sleep 60 docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8e3e4ced64..da2824c672 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -7,25 +7,19 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Func; use Appwrite\Event\Usage; -use Appwrite\Event\Validator\FunctionEvent; use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Functions\Validator\Headers; -use Appwrite\Functions\Validator\RuntimeSpecification; -use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\Task\Validator\Cron; -use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; use Appwrite\Utopia\Database\Validator\Queries\Executions; use Appwrite\Utopia\Database\Validator\Queries\Functions; use Appwrite\Utopia\Response; -use Appwrite\Utopia\Response\Model\Rule; use Executor\Executor; use MaxMind\Db\Reader; use Utopia\App; @@ -43,20 +37,14 @@ use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Query\Cursor; -use Utopia\Database\Validator\Roles; use Utopia\Database\Validator\UID; use Utopia\Storage\Device; -use Utopia\Storage\Validator\File; -use Utopia\Storage\Validator\FileExt; -use Utopia\Storage\Validator\FileSize; -use Utopia\Storage\Validator\Upload; use Utopia\Swoole\Request; use Utopia\System\System; use Utopia\Validator\AnyOf; use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; use Utopia\Validator\Boolean; -use Utopia\Validator\Nullable; use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; diff --git a/app/controllers/general.php b/app/controllers/general.php index 682af9382c..5ad8be559c 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1285,7 +1285,7 @@ App::wildcard() }); foreach (Config::getParam('services', []) as $service) { - if(!empty($service['controller'])) { + if (!empty($service['controller'])) { include_once $service['controller']; } } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/ListFunctions.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/ListFunctions.php index d07720a46a..de17a65fe3 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/ListFunctions.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/ListFunctions.php @@ -2,7 +2,6 @@ namespace Appwrite\Platform\Modules\Functions\Http\Functions; -use Utopia\Database\Exception\Query as QueryException; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; use Appwrite\SDK\AuthType; @@ -12,6 +11,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Functions; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; use Utopia\Database\Validator\Query\Cursor; use Utopia\Platform\Action; diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index e24f3d26af..0c6b5a14ff 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -145,7 +145,7 @@ class Executor ], [], true, 30); // Temporary fix for race condition - if($response['headers']['status-code'] === 500 && \str_contains($response['body']['message'], 'already in progress')) { + if ($response['headers']['status-code'] === 500 && \str_contains($response['body']['message'], 'already in progress')) { return true; // OK, removal already in progress }