schmittjoh / JMSJobQueueBundle

Run and Schedule Symfony Console Commands as Background Jobs
http://jmsyst.com/bundles/JMSJobQueueBundle
335 stars 254 forks source link

Restricted queues #103

Closed rcousens closed 9 years ago

rcousens commented 9 years ago

Rebase of #96 onto latest master to add restricted queues to run command.

I'm not particularly happy with how I butchered the DQL for cleanUpStaleJobs. Should I convert to a query builder?

rcousens commented 9 years ago

Sorry, didn't mean to push the composer.lock through to the pull request as well. Reverted.

rcousens commented 9 years ago

Just fixing this up so the tests pass. The query isn't working at the moment so I'll do it via query builder.

rcousens commented 9 years ago

Ok I got the tests passing in my own repo by updating master then merging it into the restricted_queue branch. The composer.lock in your current master is out of date and updating pulls in dependencies that require 5.5+ and the travis.yml is set to 5.3 and 5.4 only.

I've added 5.5 to travis and removed 5.3 and 5.4 as per the composer.json specifying php >= 5.5.

I also updated the tests to supply a default worker-name of 'test' as the gethostname() method on Travis that is used for generating a default when none is supplied creates a string longer than the 50 char length restriction.

I've done a composer update and committed the lock file to get the tests passing again on Travis.

rcousens commented 9 years ago

Just 1 failing test:

https://travis-ci.org/schmittjoh/JMSJobQueueBundle/jobs/69306109

Will fix it up tomorrow and then I think this is good to go.

rcousens commented 9 years ago

@schmittjoh

Summary:

I've removed PHP 5.3 and 5.4 from travis.yml and added PHP 5.5 and 5.6.

I've updated composer.lock which was way out of date. Symfony 2.8 is PHP 5.5+ and the composer.json pulls in dependencies that won't install on 5.3 and 5.4. The composer.json was already restricting the PHP version to 5.5 anyway. I also removed an erroneous duplicate entry from composer.json.

I've fixed all the failing travis tests due to a previous commit related to worker name and max length. Remaining failing test is for high concurrency. It passes locally but fails on Travis.

I'm out of ideas as to why it fails on Travis, the file is writable but returns empty when read after the logging command jobs finish.

https://travis-ci.org/rcousens/JMSJobQueueBundle/builds/69430305

rcousens commented 9 years ago

@schmittjoh I know you're busy, would really appreciate this feature making it in or feedback on what I need to do for it to pass :) It's an open feature request by other users too and if it languishes it'll fall behind again.

I spent 4 hours on cleaning things up and restored all your automated tests!

rcousens commented 9 years ago

Ok I've restored the cleanUpStaleJobs original query.

~/P/JMSJobQueueBundle ❯❯❯ phpunit
PHPUnit 4.7.6 by Sebastian Bergmann and contributors.

................................................

Time: 2.43 minutes, Memory: 48.25Mb

OK (48 tests, 142 assertions)

Works fine locally, terminate on max runtime test was skipped previously which I think is fixed with "exec" being passed into the process builder as command prefix so I have re-enabled the test (passes locally and on Travis), but the high concurrency test still fails on Travis.