diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb58f7f8cd..ba7c4cc1be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -406,7 +406,7 @@ jobs: e2e_service: name: Tests / E2E / ${{ matrix.database }} (${{ matrix.mode }}) / ${{ matrix.service }} - runs-on: ${{ matrix.runner || 'ubuntu-latest' }} + runs-on: ${{ matrix.runner || format('runs-on={0}/runner=4cpu-linux-x64/volume=120g/spot=false', github.run_id) }} needs: [build, matrix] permissions: contents: read @@ -445,19 +445,10 @@ jobs: ] include: - service: Databases - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g + runner: runs-on=${{ github.run_id }}/runner=8cpu-linux-x64/volume=120g/spot=false paratest_processes: 3 timeout_minutes: 30 - - service: Sites - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g - - service: Functions - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g - - service: Avatars - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g - - service: Realtime - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g - service: TablesDB - runner: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/family=c7/volume=120g paratest_processes: 3 timeout_minutes: 30 - service: Migrations diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 2beae74d3e..a32b990b9e 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2633,6 +2633,7 @@ class SitesCustomServerTest extends Scope // Poll for execution logs to be written (async) // Filter by requestPath to avoid picking up screenshot worker executions + // Wait for both the execution entry AND its logs field to be populated $logs = null; $timeout = 120; $start = \time(); @@ -2642,12 +2643,13 @@ class SitesCustomServerTest extends Scope Query::equal('requestPath', ['/logs-inline'])->toString(), Query::limit(1)->toString(), ]); - if (!empty($logs['body']['executions'])) { + if (!empty($logs['body']['executions']) && !empty($logs['body']['executions'][0]['logs'])) { break; } \usleep(500000); } $this->assertNotEmpty($logs['body']['executions'], 'Execution logs were not available within timeout'); + $this->assertNotNull($logs['body']['executions'][0]['logs'], 'Execution logs content was not populated within timeout'); $this->assertEquals(200, $logs['headers']['status-code']); $this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']); $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); @@ -2681,11 +2683,21 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertStringContainsString("Action logs printed.", $response['body']); - $logs = $this->listLogs($siteId, [ - Query::orderDesc('$createdAt')->toString(), - Query::equal('requestPath', ['/logs-action'])->toString(), - Query::limit(1)->toString(), - ]); + $logs = null; + $start = \time(); + while (\time() - $start < $timeout) { + $logs = $this->listLogs($siteId, [ + Query::orderDesc('$createdAt')->toString(), + Query::equal('requestPath', ['/logs-action'])->toString(), + Query::limit(1)->toString(), + ]); + if (!empty($logs['body']['executions']) && !empty($logs['body']['executions'][0]['logs'])) { + break; + } + \usleep(500000); + } + $this->assertNotEmpty($logs['body']['executions'], 'Action execution logs were not available within timeout'); + $this->assertNotNull($logs['body']['executions'][0]['logs'], 'Action execution logs content was not populated within timeout'); $this->assertEquals(200, $logs['headers']['status-code']); $this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']); $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']);