-
-
Notifications
You must be signed in to change notification settings - Fork 535
[15.0][FW] queue_job: port queue dependencies from 14.0 #476
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
[15.0][FW] queue_job: port queue dependencies from 14.0 #476
Conversation
54bc766 to
a50f84b
Compare
test_queue_job will create channels root.sub and root.sub.sub, so the tests doing the same thing will fail with a unique constraint error.
When displayed in a tab, the widget show the nodes offset, the d3 network is probably confused by the size or visibility of its canvas. Install a listener on tabs to trigger a fit() on the network.
A graph of jobs always share the same graph_uuid, which can be used to group jobs, but is also a faster way to find all the jobs of the graph. Then we can use the dependencies field to build the whole graph from the pre-selection of jobs.
Jobs waiting that their dependencies are executed cannot be requeued. They have to keep waiting their turn.
As jobs are created in the setup, but not always delayed, the __del__ warning that the job was not delayed is triggered. Create only the jobs necessary for each test.
* mock_jobs context manager with assert methods to check enqueued jobs * jobs are not stored in database, yet they can be inspected and performed during the test * the context manager works with graphs enqueued by delayable and with with_delay() * direct execution of jobs works with graphs by executing them synchronously following their topological sort
The previous implementation was incomplete, as it was setting the graph_uuid when `Job.add_depends()` was called. It had the advantage of being correct when (for e.g. a test) manually created a Job and called `add_depends()`, but it could not work when in some situations involving a group where one of the job has no job depending on it. Also, remove ``Job.add_reverse_depends()`` which is not used.
* Fix a js bug when there is no graph. * Use a single read group for multiple jobs
The fact that mocks are used is an implementation detail, and is actually hidden to the end user of the test API.
on_done() is maybe a better choice, it is less ambiguous than then() (clearer on the fact it happens on done()) and done() (less confusion with set_done()). I'll do the renaming soon, unless you have other suggestions. Ref: OCA#154 (comment)
a50f84b to
10253b4
Compare
|
|
||
| _logger.debug("%s enqueue depends started", job) | ||
| job.enqueue_waiting() | ||
| _logger.debug("%s enqueue depends done", job) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to enqueue dependencies cc @ivantodorovich
ivantodorovich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ❤️ !
leemannd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice!
|
This PR has the |
|
Any idea on when this will be merged? This is a great improvement! |
|
/ocabot merge major |
|
What a great day to merge this nice PR. Let's do it! |
|
@lmignon your merge command was aborted due to failed check(s), which you can inspect on this commit of 15.0-ocabot-merge-pr-476-by-lmignon-bump-major. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
|
A new copier update is needed due to OCA/oca-addons-repo-template#170 |
|
/ocabot merge major |
|
This PR looks fantastic, let's merge it! |
|
@lmignon The merge process could not be finalized because an exception was raised: <class 'requests.exceptions.ReadTimeout'>: A connection-level exception occurred: HTTPSConnectionPool(host='api.github.com', port=443): Read timed out. (read timeout=4). |
Port of #403 from 14.0 to 15.0.
Can be tested on Runboat.
Open the runboat url with
/queue_job/create_test_job?size=30.