diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php index ae3ed62..c190ee2 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -39,7 +39,12 @@ protected function initMink() { protected function tearDown() { // Wait for all requests to finish. It is possible that an AJAX request is // still on-going. - $this->getSession()->wait(5000, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'); + $result = $this->getSession()->wait(5000, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'); + if (!$result) { + // Throw an exception to ensure errors are not obfuscated by missing + // session table errors. + throw new \RuntimeException('Unfinished AJAX requests whilst tearing down a test'); + } parent::tearDown(); }