We're seeing inconsistent exceptions from our testing of pgsql-9.1 on the DCI platform.
https://dispatcher.drupalci.org/job/DCI_Run/326/
https://dispatcher.drupalci.org/job/DCI_Run/340/
https://dispatcher.drupalci.org/job/DCI_Run/344/
of the exceptions that are inconsistent, the output appears to say that the table isn't empty
https://dispatcher.drupalci.org/job/DCI_Run/344/testReport/junit/(root)/Drupal_comment_Tests_Views_CommentFieldNameTest/install_begin_request__/
Failed
Drupal\comment\Tests\Views\CommentFieldNameTest.install_begin_request() (from (Drupal_comment_Tests_Views_CommentFieldNameTest.xml))
Failing for the past 1 build (Since Unstable#344 )
Took 0 ms.
add description
Error Message
Uncaught exception
Stacktrace
<em class="placeholder">Drupal\Core\Installer\Exception\AlreadyInstalledException</em>: <ul>
<li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
<li>To upgrade an existing installation, proceed to the <a href="/update.php">update script</a>.</li>
<li>View your <a href="http://localhost">existing site</a>.</li>
</ul> in <em class="placeholder">install_begin_request()</em> (line <em class="placeholder">482</em> of <em class="placeholder">/var/www/html/core/includes/install.core.inc</em>). <pre class="backtrace">install_begin_request(Object, Array)
install_drupal(Object, Array)
Drupal\simpletest\WebTestBase->doInstall(Array)
Drupal\simpletest\WebTestBase->setUp()
Drupal\views\Tests\ViewTestBase->setUp()
Drupal\comment\Tests\Views\CommentTestBase->setUp()
Drupal\comment\Tests\Views\CommentFieldNameTest->setUp()
Drupal\simpletest\TestBase->run(Array)
simpletest_script_run_one_test('129', 'Drupal\comment\Tests\Views\CommentFieldNameTest')
</pre>
line: 482
file: /var/www/html/core/includes/install.core.inc
The same type of issue appears to happen on pgsql-9.4 and sqlite-3.8
Comments
Comment #1
isntall commentedComment #2
bzrudi71 commentedThanks @isntall for opening this issue. I can confirm the random exceptions and they are all about AlreadyInstalledException(). I think the higher the DCI_Concurrency, the higher the exceptions. Added missing tags...
Comment #3
isntall commented@bzrudi71
the concurrency does matter quite a bit.
with a concurrency of 3 the exception can still happen (though not as often)
Comment #4
bzrudi71 commentedThanks @isntall for the additional test with lower concurrency! It's way better than with a concurrency of 27, I just don't get why and where exactly this happens. Spend already some hours tracing this down with no luck, guess we need @amateescu here once we get the SQLite randoms done :)
BTW: Not sure if this a known issue, but if there are exceptions during a bot run on drupalCI the result still has a status of 'SUCCESS'!? Please see this run as an example.
Comment #5
andypostMaybe that's caused previous steps in installer where few
Database::static methods are called so makes some internal structures dirty...Comment #6
bzrudi71 commentedYup, very strange thinks seem to happen as we also see random fails in the Installer test group itself. Just stumbled upon #2459671: [PP-1] Add detail to AlreadyInstalledException and think this can help us a bit to identify the main cause. I have no time today to run a bot test with #2459671: [PP-1] Add detail to AlreadyInstalledException applied, but will try to do tomorrow...
Comment #7
andypostI tryed this to run locally (ubuntu pg 9.4)
got some failures when running 3 concurrent tests in separate terms
then after installing simpletest module have no failures
the failed test reports absence of different tables, key_value and like that:
Comment #8
xjm@catch suggested we might be able to work around this and #2508567: DrupalCI SQLite random failures by at least temporarily using single concurrency for the SQLite and Postgres builds, which could be acceptable since these test suites mostly only run nightly. Is that an option to get more reliable results from DrupalCI until any other issues are resolved?
Comment #9
webchickTagging.
Comment #10
mradcliffeI finally got DCI on my home linux box running docker natively instead of via VM. Running with concurrency 27 I run into similar random exceptions for pgsql-9.1-php-5.5 and mysql-5.5-php-5.5. The exceptions are of the same class: PDOException due to SQLite database locking (related: #1713332: The SQLite database driver fails to drop simpletest tables).
It would be curious to look at the sqlite artifacts for all test builds and run the query in sqlite3
SELECT test_class, message FROM simpletest WHERE status = 'exception';setting, and compare the results. For easy of use, set.output <FILE>.Comment #11
mradcliffeAlso pgsql-9.1-php-5.5 is running at concurrency 28 rather than 27 as the rest of the config sets are.
Comment #12
isntall commentedI'll switch pgsql-9.1-php-5.5 to default to 27 concurrency for consistency.
Comment #13
mradcliffeHere's a patch that increases volatility of sqlite test-runner database and may improve scalability for concurrent test runners.
Comment #14
mradcliffeBuilds started, I don't see any random exceptions in sqlite yet, but I do see them still on the postgresql test build.
Comment #15
mradcliffeDidn't seem to improve sqlite performance either on drupalci. :(
Comment #16
mradcliffeNext option seems to be to try to reduce IO use by PostgreSQL so that SQLite does not lock: #2548439: Turn autovacuum off on pgsql containers.
Comment #17
mradcliffeThis is no longer about a few exceptions, but about a general catastrophe. We can't even finish a testbot run because docker stops reporting back at some point, which means we cannot even get meaningful results to see what is wrong.
There are probably at least 4 or 5 issues at the moment if not more, including
Finally the problem is going to keep getting worse and not better.
We cannot stop the bleeding if we keep shooting it.
Comment #18
bzrudi71 commentedGreat, my last comment got lost on preview, so again in a shorter version.
The last successfully build (with the randoms) was on 10. Aug. 2015 build #124. As of build #125 bot did no longer complete a full run. We need the drupalCI guys here to figure out what is going on. New image deployed and if so which branch in use?
Looking at Jenkins I see that the pgsql-9.1 image is pulled and later on also pgsql-9.4!?
#17.2 The serialization exceptions are all about:
unserialize(): Error at offset 61 of 64 bytesunserialize('O:48:"Drupal\Core\StringTranslation\TranslationWrapper":3:{s:9:"')So it seems this is a one fix for all ;)
#17.3 Didn't see/noticed this locally but exactly what you described in #17.4
#17.5 Fix is under way #2542124: Drupal\views\Tests\Handler\FieldFieldTest fails on Postgres :)
Comment #19
webchickdrumm pointed out that #2336627: Deadlock on cache_config (DatabaseBackend::setMultiple()) was also committed that day and could be the culprit.
Going to try reverting that patch, as well as #2549745: Make DatabaseBackend::doSetMultiple protected, and see what happens.
Comment #21
mradcliffeFor posterity, history, and spam: there was a follow-up to that issue that might have caused the revert patch to not apply: #2549745: Make DatabaseBackend::doSetMultiple protectedI looked at bright shiny red fail message and IRC instead of comment text.Comment #22
amateescu commented@webchick, I did a similar revert patch in #2126447-71: Patch testing and the pgsql bot was back to 13k passes, so we know that the new Upsert query used by #2336627: Deadlock on cache_config (DatabaseBackend::setMultiple()) is the problem.
We're trying to fix it in #2549323: Improve the Upsert query implementation for PostgreSQL :)
Comment #23
webchickThank you!
Comment #24
catchThat issue was committed, but I see 106 failures in the last test run?
Comment #25
mradcliffeThat commit was to make the test bot complete a test run again.
Most of the failures are because, somehow, the update path tests won't actually run because the menu gets rebuilt before the update that rebuilds the menu. But only on PostgreSQL - #2548725: Fix regression to menu serialization in upgrade path that causes thousands of errors in PostgreSQL.
Changing to task.
Comment #26
catchIf those test failures are non-random and just a core bug (which I've just bumped to critical at least for now) - does that mean this issue is fixed?
Comment #27
alexpotthttps://twitter.com/alexpott/status/639425771291967488