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

Fatal error when running test suite on most recent master #446

Closed
m4olivei opened this issue Dec 13, 2017 · 4 comments
Closed

Fatal error when running test suite on most recent master #446

m4olivei opened this issue Dec 13, 2017 · 4 comments

Comments

@m4olivei
Copy link
Contributor

Since updating to the latest master our Behat test suite is consistently failing with this message:

Behat\Testwork\Call\Exception\FatalThrowableError: Fatal error: Call to a member function deleteAllCookies() on null in /var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:359

The only relevant change that I can see is that the drupal/drupal-extension package was updated from ca50162dada22330953f09822f1331bf3aec89b3 to 2eb9232390cf9c251884da713c761131635692ba.

@m4olivei m4olivei changed the title Behat\Testwork\Call\Exception\FatalThrowableError: Fatal error: Call to a member function deleteAllCookies() on null in /var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:359 Fatal error when running test suite on most recent master Dec 13, 2017
@m4olivei
Copy link
Contributor Author

Pinning to ca50162dada22330953f09822f1331bf3aec89b3 fixed the issue. Here is the whole stack trace of the error:

Given I am logged in as a user with the "administrator" role               # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
      Behat\Testwork\Call\Exception\FatalThrowableError: Fatal error: Call to a member function deleteAllCookies() on null in /var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:359
      Stack trace:
      #0 /var/www/html/vendor/behat/mink/src/Session.php(103): Behat\Mink\Driver\Selenium2Driver->reset()
      #1 /var/www/html/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php(133): Behat\Mink\Session->reset()
      #2 /var/www/html/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php(48): Drupal\DrupalExtension\Manager\DrupalAuthenticationManager->fastLogout()
      #3 /var/www/html/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php(530): Drupal\DrupalExtension\Manager\DrupalAuthenticationManager->logIn(Object(stdClass))
      #4 /var/www/html/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/DrupalContext.php(66): Drupal\DrupalExtension\Context\RawDrupalContext->login(Object(stdClass))
      #5 [internal function]: Drupal\DrupalExtension\Context\DrupalContext->assertAuthenticatedByRole('administrator')
      #6 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php(109): call_user_func_array(Array, Array)
      #7 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php(64): Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall(Object(Behat\Behat\Definition\Call\DefinitionCall))
      #8 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php(140): Behat\Testwork\Call\Handler\RuntimeCallHandler->handleCall(Object(Behat\Behat\Definition\Call\DefinitionCall))
      #9 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php(96): Behat\Testwork\Call\CallCenter->handleCall(Object(Behat\Behat\Definition\Call\DefinitionCall))
      #10 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php(125): Behat\Testwork\Call\CallCenter->makeCall(Object(Behat\Behat\Definition\Call\DefinitionCall))
      #11 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php(73): Behat\Behat\Tester\Runtime\RuntimeStepTester->testDefinition(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\StepNode), Object(Behat\Behat\Definition\SearchResult), false)
      #12 /var/www/html/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableStepTester.php(74): Behat\Behat\Tester\Runtime\RuntimeStepTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\StepNode), false)
      #13 /var/www/html/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php(73): Behat\Behat\Hook\Tester\HookableStepTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\StepNode), false)
      #14 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php(59): Behat\Behat\EventDispatcher\Tester\EventDispatchingStepTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\StepNode), false)
      #15 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php(76): Behat\Behat\Tester\StepContainerTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\ScenarioNode), false)
      #16 /var/www/html/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableScenarioTester.php(74): Behat\Behat\Tester\Runtime\RuntimeScenarioTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\ScenarioNode), false)
      #17 /var/www/html/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php(103): Behat\Behat\Hook\Tester\HookableScenarioTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\ScenarioNode), false)
      #18 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/IsolatingScenarioTester.php(69): Behat\Behat\EventDispatcher\Tester\EventDispatchingScenarioTester->test(Object(Behat\Behat\Context\Environment\InitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\ScenarioNode), false)
      #19 /var/www/html/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php(84): Behat\Behat\Tester\Runtime\IsolatingScenarioTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), Object(Behat\Gherkin\Node\ScenarioNode), false)
      #20 /var/www/html/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php(72): Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), false)
      #21 /var/www/html/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php(71): Behat\Behat\Hook\Tester\HookableFeatureTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), false)
      #22 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php(63): Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Gherkin\Node\FeatureNode), false)
      #23 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php(73): Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Testwork\Specification\GroupedSpecificationIterator), false)
      #24 /var/www/html/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php(72): Behat\Testwork\Hook\Tester\HookableSuiteTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Testwork\Specification\GroupedSpecificationIterator), false)
      #25 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php(71): Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test(Object(Behat\Behat\Context\Environment\UninitializedContextEnvironment), Object(Behat\Testwork\Specification\GroupedSpecificationIterator), false)
      #26 /var/www/html/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php(70): Behat\Testwork\Tester\Runtime\RuntimeExercise->test(Array, false)
      #27 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php(80): Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test(Array, false)
      #28 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php(149): Behat\Testwork\Ordering\OrderedExercise->test(Array, false)
      #29 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php(108): Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications(Object(Symfony\Component\Console\Input\ArgvInput), Array)
      #30 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Cli/Command.php(63): Behat\Testwork\Tester\Cli\ExerciseController->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #31 /var/www/html/vendor/symfony/console/Command/Command.php(264): Behat\Testwork\Cli\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #32 /var/www/html/vendor/symfony/console/Application.php(841): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #33 /var/www/html/vendor/symfony/console/Application.php(206): Symfony\Component\Console\Application->doRunCommand(Object(Behat\Testwork\Cli\Command), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #34 /var/www/html/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #35 /var/www/html/vendor/symfony/console/Application.php(125): Behat\Testwork\Cli\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      #36 /var/www/html/vendor/behat/behat/bin/behat(34): Symfony\Component\Console\Application->run()
      #37 {main}

@m4olivei
Copy link
Contributor Author

m4olivei commented Dec 13, 2017

Judging by the latest commits, I'd wager that PR #427 has something to do with the error, based on the face that it introduces \Drupal\DrupalExtension\Manager\DrupalAuthenticationManager::fastLogout and that function is in the stack trace of the error.

Just a theory for now though.

m4olivei added a commit to m4olivei/drupalextension that referenced this issue Dec 13, 2017
m4olivei added a commit to m4olivei/drupalextension that referenced this issue Dec 13, 2017
m4olivei added a commit to m4olivei/drupalextension that referenced this issue Dec 14, 2017
jhedstrom added a commit that referenced this issue Dec 15, 2017
#446 Check for session first before logging out in fastLogout method of DrupalAuthenticationManager
@jhedstrom
Copy link
Owner

Thanks for the fix!

@m4olivei
Copy link
Contributor Author

My pleasure! Thanks for the quick response!

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

2 participants