We are using Behat and the drupalextension extensively on Commerce Kickstart 2.x and Panopoly. However, randomly we get the following issue #2231631: Tests randomly fail with "MySQL server has gone away" (take 4). It happens after all the Behat tests has run. Have you experienced this issue?

Comments

jhedstrom’s picture

I didn't experience that exact issue, but I have run into issues with modules that register shutdown functions. Since a Behat run can cover many many 'page loads' (as Drupal modules are typically thinking), by the time the shutdown functions are actually called, much of the underlying data (such as node objects) no longer exist. This code removes shutdown functions:

  /**
   * Register a shutdown function.
   *
   * We manually call shutdown functions, so register one to exit immediately.
   *
   * @BeforeSuite
   */
  public static function registerShutdownFunction() {
    register_shutdown_function('FeatureContext::shutdownFunction');
  }

  /**
   * The shutdown function to skip all others.
   */
  public static function shutdownFunction() {
    exit;
  }

Also available here: https://gist.github.com/jhedstrom/0c06cf2caca1cac0b517

lsolesen’s picture

jhedstrom’s picture

Status: Active » Postponed (maintainer needs more info)

Did you folks ever figure this one out?

eliza411’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Looks like this has been figured out: #2231631