Skip to content

Improve DBA test suite #8904

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 12 commits into from
Jul 28, 2022
Merged

Improve DBA test suite #8904

merged 12 commits into from
Jul 28, 2022

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jul 1, 2022

Main drive for this is to make the DBA tests parallel and remove redundant tests that are now covered in a large suite for all drivers.

I don't have the db1, db2, db3, dbm and ndbm drivers so those are best guesses for the expectation of the tests.

Other objectives of this improved suite is to make the DB4 test which tests opening of a DB run on all the other drivers, as this has found an issue with LMDB.

@cmb69
Copy link
Member

cmb69 commented Jul 1, 2022

I don't have the db1, db2, db3,

Does anybody else? I suggested to drop support for these three some years ago, but nothing came out of it. Unfortunately, some links in this thread no longer present the relevant information, but if it is true that Berkeley DB 3.3.11 was the final release of the 3.XX versions, and has been released on 2001-07-12, it appears to be silly to spend any effort on that; except for dropping support.

@Girgias
Copy link
Member Author

Girgias commented Jul 1, 2022

I don't have the db1, db2, db3,

Does anybody else? I suggested to drop support for these three some years ago, but nothing came out of it. Unfortunately, some links in this thread no longer present the relevant information, but if it is true that Berkeley DB 3.3.11 was the final release of the 3.XX versions, and has been released on 2001-07-12, it appears to be silly to spend any effort on that; except for dropping support.

Right, that's what I'm also thinking, I don't think we can just drop support in 8.2 especially as we don't have time for an RFC :/

@Girgias Girgias force-pushed the dba-tests-improvement branch from 660370d to 2d5cc4d Compare July 21, 2022 13:11
@Girgias Girgias marked this pull request as ready for review July 21, 2022 13:11
@Girgias Girgias force-pushed the dba-tests-improvement branch from 2d5cc4d to 1a62fd0 Compare July 21, 2022 15:21
@Girgias Girgias force-pushed the dba-tests-improvement branch 4 times, most recently from d25c718 to 5995d3c Compare July 26, 2022 11:10
@Girgias
Copy link
Member Author

Girgias commented Jul 26, 2022

@cmb69 I don't understand why I'm getting a segfault on Windows:

========DIFF========
--
     Mode parameter is "cd":
     This is a test insert
     Mode parameter is "c-":
039+ 
040+ Termsig=-1073741819
039- This is a test insert

For FAIL DBA flatfile opening matrix of combination [C:\projects\php-src\ext\dba\tests\dba_flatfile_creation_matrix.phpt] (and 2 other tests which are similar)`` I though maybe 5995d3c would do something to help it but seems not.

Could you have a look?

@cmb69
Copy link
Member

cmb69 commented Jul 26, 2022

It seems you've found a (long standing) bug. Simple reproducer: dba_open("non-existing-file", "c-", "flatfile"). The problem is that we're trying to free a NULL pointer:

php_stream_free(info->lock.fp, persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE);

The simplest solution would be to only free if info->lock.fp is set. However, there is no need to close the streams and to restart if we don't want to lock at all. This could be caught in the else if clause a few lines above. And frankly, I'm not sure whether this restarting is necessary nowadays.

Anyhow, I'll come up with a fix, and suggest you ignore that problem for now. It might also be good to revert 5995d3c.

PS: after closer investigation, I found that I misinterpreted the restart.

Girgias added 12 commits July 28, 2022 15:00
Improve testing, remove redundant ones
Preliminary support for parallel runs
This replaces various other tests
The aim is to run such a matrix for each driver
Also make test resilliants for 'any driver' as cdb and inifile are weird
TODO Actually test GDBM as cannot test QDBM and it at the same time due to conflicts
Also LMDB fails earlier now in some cases
@Girgias Girgias force-pushed the dba-tests-improvement branch from 99cb050 to fb576f8 Compare July 28, 2022 14:00
@Girgias Girgias merged commit eddab74 into php:master Jul 28, 2022
@Girgias Girgias deleted the dba-tests-improvement branch July 28, 2022 18:36
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.

2 participants