Skip to content

Commit

Permalink
Merge branch 'fix-player-profile-binding-issue' into 'main'
Browse files Browse the repository at this point in the history
[player] stop attaching the profile uuid to step before ensuring the profile is ready

See merge request platformsh/observability/blackfire/blackfire.io!36926
  • Loading branch information
julien-jean committed Jan 8, 2025
2 parents 3558be8 + 8958695 commit 5b31958
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Player/Extension/BlackfireExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use Blackfire\Player\Step\Step;
use Blackfire\Player\Step\StepContext;
use Blackfire\Player\Step\StepInitiatorInterface;
use Blackfire\Profile;
use Blackfire\Profile\Configuration as ProfileConfiguration;

/**
Expand Down Expand Up @@ -210,8 +211,9 @@ public function afterStep(AbstractStep $step, StepContext $stepContext, Scenario
}

$parentStep = $step->getInitiator();
$profile = $this->blackfire->getProfile($uuid);
$parentStep->setBlackfireProfileUuid($uuid);
$this->assertProfile($parentStep, $uuid);
$this->assertProfile($parentStep, $profile);
}
}

Expand Down Expand Up @@ -249,10 +251,8 @@ private function createBuildProfileConfig(Step $step, StepContext $stepContext,
return $config;
}

private function assertProfile(Step $step, string $blackfireProfileUuid): void
private function assertProfile(Step $step, Profile $profile): void
{
$profile = $this->blackfire->getProfile($blackfireProfileUuid);

if ($profile->isErrored()) {
if ($profile->getTests()) {
throw new ExpectationErrorException('At least one assertion is invalid.');
Expand Down

0 comments on commit 5b31958

Please sign in to comment.