Skip to content

Parallelize pdo tests (dblib, firebird, oci, odbc, pgsql) #12395

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

Merged
merged 14 commits into from
Oct 28, 2023

Conversation

kocsismate
Copy link
Member

It becomes possible by using different SQL symbols in all tests.

@jorgsowa
Copy link
Contributor

There is still one PR waiting for review with a similar goal: #11879

@kocsismate
Copy link
Member Author

There is still one PR waiting for review with a similar goal: #11879

Oh nice, thanks for pointing this out! It's just mere luck that I didn't yet include the MySQL implementation in my PR ^^

@kocsismate
Copy link
Member Author

kocsismate commented Oct 10, 2023

Now that I added --CLEAN-- sections without IF EXISTS clauses to ext/pdo/tests/ , SQLite tests started to fail because they run in-memory. Neither simply adding IF EXIST work, because older Oracle servers don't support the DROP TABLE IF EXISTS ... construct. That's why I'll have to apply some fix (either special case the oracle implementation, or skip the cleanup for sqlite - I lean towards the latter one).

@kocsismate kocsismate force-pushed the pdo-test-parallel branch 2 times, most recently from eb9955d to 25820bb Compare October 12, 2023 12:44
@kocsismate kocsismate force-pushed the pdo-test-parallel branch 2 times, most recently from ef94333 to fbc9c85 Compare October 16, 2023 21:11
@Girgias
Copy link
Member

Girgias commented Oct 16, 2023

Main remain issues seems to be Firebird on Windows

@Girgias
Copy link
Member

Girgias commented Oct 18, 2023

Still slightly broken

Windows:

 =====================================================================
BORKED TEST SUMMARY
---------------------------------------------------------------------

Warning: PDO::exec(): SQLSTATE[HY000]: General error in D:\a\php-src\php-src\ext\pdo\tests\pdo_test.inc on line 90
 [D:\a\php-src\php-src\ext\pdo\tests\pecl_bug_5217.phpt]

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error in D:\a\php-src\php-src\ext\pdo_firebird\tests\ddl.clean.php:5
Stack trace:
#0 D:\a\php-src\php-src\ext\pdo_firebird\tests\ddl.clean.php(5): PDO->exec('DROP TRIGGER dd...')
#1 {main}
  thrown in D:\a\php-src\php-src\ext\pdo_firebird\tests\ddl.clean.php on line 5
 [D:\a\php-src\php-src\ext\pdo_firebird\tests\ddl.phpt]

Warning: PDO::exec(): SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "EXIST"
LINE 1: DROP TABLE IF EXIST test36727
                      ^ in D:\a\php-src\php-src\ext\pdo_pgsql\tests\bug36727.clean.php on line 4
 [D:\a\php-src\php-src\ext\pdo_pgsql\tests\bug36727.phpt]

Warning: PDO::exec(): SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "EXIST"
LINE 1: DROP TABLE IF EXIST test43925
                      ^ in D:\a\php-src\php-src\ext\pdo_pgsql\tests\bug43925.clean.php on line 4
 [D:\a\php-src\php-src\ext\pdo_pgsql\tests\bug43925.phpt]
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
via [D:\a\php-src\php-src\ext\pdo_firebird\tests\common.phpt]
	FIREBIRD PDO Common: transactions [ext\pdo_firebird\tests\pdo_017.phpt]
=====================================================================

And Linux CI:

=====================================================================
BORKED TEST SUMMARY
---------------------------------------------------------------------

Parse error: syntax error, unexpected double-quote mark, expecting ")" in /home/runner/work/php-src/php-src/ext/pdo_oci/tests/pdo_oci_attr_autocommit_2.clean.php on line 4
 [/home/runner/work/php-src/php-src/ext/pdo_oci/tests/pdo_oci_attr_autocommit_2.phpt]
=====================================================================

As I suppose there is still some concurrency issue.
@Girgias
Copy link
Member

Girgias commented Oct 21, 2023

This also happened on a previous CI run:

001+ Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 20018 Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [20018] (severity 13) [select *
002+ from information_schema.columns ic1
003+ cross join information_schema.columns ic2
004+ cross join information_schema.columns ic3] in /home/runner/work/php-src/php-src/ext/pdo_dblib/tests/bug_50755.php:12
005+ Stack trace:
006+ #0 /home/runner/work/php-src/php-src/ext/pdo_dblib/tests/bug_50755.php(12): PDOStatement->fetch()
007+ #1 {main}
008+   thrown in /home/runner/work/php-src/php-src/ext/pdo_dblib/tests/bug_50755.php on line 12
========DONE========
FAIL PDO_DBLIB: Out of memory on large recordsets [ext/pdo_dblib/tests/bug_50755.phpt] 

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the following test start a transaction without closing it properly:

  • ext/pdo/tests/bug_34630.phpt

Maybe the ddl and pdo017 tests need to be marked as conflicting.

@kocsismate
Copy link
Member Author

ext/pdo/tests/bug_34630.phpt

Hmm, interesting idea, but it looks like the transaction is related to OCI8 only. :/

Maybe the ddl and pdo017 tests need to be marked as conflicting.

Yeah, I had already re-aadded the CONFLICTS file for firebird. Doing so apparently fixed a bunch of failures.

Maybe just skip the test for now on Firebird, as it might be a bug in the driver... (this skip is taken from pdo039.phpt)

Yeah, I tend to do so soon, but I'd still prefer to find out the root cause even though these random failures drive me nuts.. I thought parallelization will be easy to do... :/

@kocsismate
Copy link
Member Author

I had enough, I xfailed it...

@Girgias Girgias merged commit f4a5db3 into php:master Oct 28, 2023
@Girgias
Copy link
Member

Girgias commented Oct 28, 2023

Merged as is, thank you!

@kocsismate kocsismate deleted the pdo-test-parallel branch October 29, 2023 09:41
@iluuu1994
Copy link
Member

@Girgias
Copy link
Member

Girgias commented Oct 29, 2023

I'm having a look

@iluuu1994
Copy link
Member

ODBC frequently deadlocks in nightly. https://github.com/php/php-src/actions/runs/6792494456/job/18465897192 Can we re-unparallelize this, at least for CI only? I don't think there's currently an option for this, maybe allow CONFLICTS to be a PHP section and then opt-into parallelized execution using an env var?

@Girgias
Copy link
Member

Girgias commented Nov 8, 2023

ODBC frequently deadlocks in nightly. https://github.com/php/php-src/actions/runs/6792494456/job/18465897192 Can we re-unparallelize this, at least for CI only? I don't think there's currently an option for this, maybe allow CONFLICTS to be a PHP section and then opt-into parallelized execution using an env var?

I think just readding the CONFLICT file is better for the moment.

@iluuu1994
Copy link
Member

I re-added the CONFLICTS files. Feel free to remove them if you can improve the stability, or maybe rather just enable parallelization for local development.

@kocsismate
Copy link
Member Author

Thanks Ilija, I wasn't able to add the conflicts file yesterday. I am fed up fixing these locking issues so I am fine with the current circumvention.

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

Successfully merging this pull request may close these issues.

4 participants