php / pecl-networking-gearman

PHP wrapper to libgearman
https://pecl.php.net/package/gearman
Other
33 stars 25 forks source link

gearman_worker_test_018.phpt testing failure #34

Closed esabol closed 1 month ago

esabol commented 1 month ago

I'm working on adding a GitHub CI workflow to this project. It's almost working except that I'm getting one test failure in gearman_worker_test_018.phpt.

You can see my CI runs here:

https://github.com/esabol/pecl-networking-gearman/actions/runs/11266559682

But, in each case, it basically boils down to this:

TEST 65/66 [tests/gearman_worker_018.phpt]
========DIFF========
--
     Exception 4 caught: Failed to set exception option
     Exception 5 caught: Failed to set exception option
     Exception 6 caught: Failed to set exception option
007- OK
007+ 
008+ Fatal error: Uncaught GearmanException: Failed to set exception option in /home/runner/work/pecl-networking-gearman/pecl-networking-gearman/tests/gearman_worker_018.php:69
009+ Stack trace:
010+ #0 /home/runner/work/pecl-networking-gearman/pecl-networking-gearman/tests/gearman_worker_018.php(69): GearmanWorker->addServer('localhost', 4730)
011+ #1 {main}
012+   thrown in /home/runner/work/pecl-networking-gearman/pecl-networking-gearman/tests/gearman_worker_018.php on line 69
========DONE========
FAIL GearmanWorker::enableExceptionHandler(),gearman_worker_enable_exception_handler() [tests/gearman_worker_018.phpt]

The issue seems to be with the following tests in gearman_worker_018.phpt:

// Test 7: GearmanWorker::addServer, default (positive case)
$worker7 = new GearmanWorker();
$worker7->addServer('localhost', 4730);

// Test 8: GearmanWorker::addServer, explicitly set enableExceptionHandler (positive case)
$worker8 = new GearmanWorker();
$worker8->addServer('localhost', 4730, true);

// Test 9: GearmanWorker::addServer, call enableExceptionHandler (positive case)
$worker9 = new GearmanWorker();
$worker9->addServer('localhost', 4730, false);
$worker9->enableExceptionHandler();

The corresponding gearman_client_021.phpt which tests exception handling for the client does not have these 3 tests. The files are otherwise identical except for s/client/worker/ig changes.

Should these tests be removed from gearman_worker_018.phpt so that the tests will pass? CI runs with these tests removed

Or can these tests be modified so that they will pass somehow?

esabol commented 1 month ago

Oh, I'm being silly. Instead of running "make test", I was running "php -n run-tests.php -n -d extension_dir=modules -d extension=gearman --show-diff tests" (which I got from another php/pecl-* project). If I use "make test", the test passes.