diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 3e8a7e1f5a..7d48699a88 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -1972,7 +1972,25 @@ final class FunctionsCustomServerTest extends Scope public function testCreateExecution(): void { - $data = $this->setupTestDeployment(); + // Other deployment tests can replace the cached function's active build. + // Own the function here so the execution identity has a stable target. + $functionId = $this->setupFunction([ + 'functionId' => ID::unique(), + 'name' => 'Test1', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', + 'timeout' => 15, + ]); + $variable = $this->createVariable($functionId, [ + 'key' => 'GLOBAL_VARIABLE', + 'value' => 'Global Variable Value', + ]); + $this->assertEquals(201, $variable['headers']['status-code']); + $deploymentId = $this->setupDeployment($functionId, [ + 'code' => $this->packageFunction('basic'), + 'activate' => true, + ]); + $data = ['functionId' => $functionId, 'deploymentId' => $deploymentId]; /** * Test for SUCCESS