Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization of 'Closure' is not allowed #902

Open
snez opened this issue May 10, 2023 · 1 comment
Open

Serialization of 'Closure' is not allowed #902

snez opened this issue May 10, 2023 · 1 comment

Comments

@snez
Copy link

snez commented May 10, 2023

We have started noticing failures in our test suite about a week ago, with no changes on our side. After investigation, we found the problem to have been caused by the release of v4.3.0 of the Magento functional testing framework. After downgrading to v4.2.1, the problem was resolved. Reporting the details here for reference.

Preconditions

  1. Magento 2.4.6
  2. PHP 8.2
  3. v4.3.0 of the framework

Steps to reproduce

  1. Implement an MFTF test which fails intentionally. Successful tests do not have this problem
  2. Add the test in a test suite, with at least one more test after it

Expected result

  1. The test should fail with a recorded screenshot
  2. The next test should start

Actual result

  1. The test fails, and the entire test suite stops in its track, preventing allure reports from being generated. Example below:

  [waitForFullScreenIframe] wait for element "//iframe[@name='acsFrame']",30
  [saveScreenshot] save screenshot
  [] [START AFTER HOOK]
[] [logoutStorefront] StorefrontCustomerLogoutActionGroup
  [storefrontSignOut] am on page "customer/account/logout/"
  [waitForSignOut] wait for page load 60
[END AFTER HOOK]
 ERROR

--------------------------------------------------------------------------------

In AllureHelper.php line 26:

  [Exception]
  Serialization of 'Closure' is not allowed


Exception trace:
  at vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/AllureHelper.php:26
 serialize() at vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/AllureHelper.php:26
 Magento\FunctionalTestingFramework\Allure\AllureHelper::addAttachmentToCurrentStep() at vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php:268
 Magento\FunctionalTestingFramework\Extension\TestContextExtension->attachExceptionToAllure() at vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php:139
 Magento\FunctionalTestingFramework\Extension\TestContextExtension->testEnd() at vendor/symfony/event-dispatcher/EventDispatcher.php:206
 Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at vendor/symfony/event-dispatcher/EventDispatcher.php:56
 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at vendor/codeception/codeception/src/Codeception/Test/Test.php:243
 Codeception\Test\Test->realRun() at vendor/codeception/codeception/src/Codeception/Suite.php:130
 Codeception\Suite->run() at vendor/codeception/codeception/src/Codeception/SuiteManager.php:148
 Codeception\SuiteManager->run() at vendor/codeception/codeception/src/Codeception/Codecept.php:260
 Codeception\Codecept->runSuite() at vendor/codeception/codeception/src/Codeception/Codecept.php:216
 Codeception\Codecept->run() at vendor/codeception/codeception/src/Codeception/Command/Run.php:646
 Codeception\Command\Run->runSuites() at vendor/codeception/codeception/src/Codeception/Command/Run.php:467
 Codeception\Command\Run->execute() at vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at vendor/codeception/codeception/src/Codeception/Application.php:112
 Codeception\Application->run() at vendor/codeception/codeception/app.php:45
 {closure}() at vendor/codeception/codeception/app.php:46
 require() at vendor/codeception/codeception/codecept:7
 include() at vendor/bin/codecept:120
@m2-assistant
Copy link

m2-assistant bot commented May 10, 2023

Hi @snez. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant