-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
…ility to the Job class.
Now sleep even through success or failure 💤
Or else the state we have for the job will be outdated.
…own thread instance.
@benjaoming you'll be happy to know that I added a changelog based on http://keepachangelog.com/en/0.3.0/ :) |
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
|
||
## [Unreleased] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
setup.py
Outdated
|
||
def read_file(fname): | ||
""" | ||
Read file and decode in py2k | ||
""" | ||
if sys.version_info < (3,): | ||
if IS_PYTHON_2: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/barbequeue/common/classes.py
Outdated
|
||
Jobs are stored on the storage backend for persistence through restarts, and are scheduled for running | ||
to the workers. | ||
""" | ||
class State(enum.Enum): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/barbequeue/common/classes.py
Outdated
def shutdown(self): | ||
# stub method, override if you need a more complex shut down procedure. | ||
pass | ||
return float(self.progress) / self.total_progress |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/barbequeue/scheduler/classes.py
Outdated
self.scheduler_thread.setDaemon(True) | ||
def start_scheduler(self): | ||
self.scheduler_thread = InfiniteLoopThread(func=self.schedule_next_job, thread_name="SCHEDULER", | ||
wait_between_runs=0.5) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/barbequeue/scheduler/classes.py
Outdated
def start_worker_message_handler(self): | ||
self.worker_message_handler_thread = InfiniteLoopThread(func=lambda: self.handle_worker_messages(timeout=2), | ||
thread_name="WORKERMESSAGEHANDLER", | ||
wait_between_runs=0.5) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
from collections import defaultdict | ||
from threading import Event | ||
|
||
JOB_EVENT_MAPPING = defaultdict(lambda: Event()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
except queue.Empty: | ||
# Maybe it's been processed already... just continue anyway then. | ||
inmem_client._storage.wait_for_job_update(job_id, timeout=2) | ||
except Exception: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -28,7 +29,7 @@ def test_can_schedule_single_job(self, defaultbackend, simplejob): | |||
new_job = defaultbackend.get_job(job_id) | |||
|
|||
# Does the returned job record the function we set to run? | |||
assert str(new_job.func) == str(id) | |||
assert str(new_job.func) == stringify_func(id) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
If you rebase/merge |
Thanks! Looking over your changes now. Some quick notes: The usage of the I generally don't put logging statements in my testing code, as the default |
If six does it, we should use six. For things that aren't supplied in six, it's very important to gather the compatibility hacks in one place. Otherwise they linger around forever. Been removing plenty of stale 2.5 and 2.6 compatibility hacks :) |
We can do lots of logging because pytest is clever enough to not display any of the logging done by successful tests.. Anyways, having lots of logging will also make test code less readable. So probably not so nice to leave it around. Was looking at test code in Django, and they don't log anything. I don't remember where my original comment about it was, but it had to do with a test that froze and I couldn't even know what test it was executing and get the logging output. So in this case I could troubleshoot it by logging and using |
ca768f4
to
24602c5
Compare
Jobs aren't being viewed still :(
Test builds are complaining about not finding a |
latter is not an exception
Else we have contentions for connections
Needed to have feature parity with django_q.
…ype and storage location
@aronasorman let me know anytime you want a mid-term review :) |
Hi @aronasorman ! So the commit 391bb9f in this unmerged PR is the one that Kolibri is currently running on? :) There are two quick comments remaining from my previous review, that I think you can fix up quickly? I'm optimistic we should get this merged and try to get on track with smaller issues, PRs, and versioning+releasing of Iceqube (yeah the name refactor is probably best to have cleared, too).. it seems easier than sitting on this rather lengthy PR and starting to release Kolibri with some commit ID ref'ed in a dependency link. |
Apparently on Android, even just importing processpoolexecutor would cause an error.
Think I addressed the important comments, merging this in now! |
pytest-mock==1.6.0 | ||
pytest-cov |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #5 and #11. Changes:
1 test is failingall tests are passing on python 3.6!Added:
So the general API found in
InMemClient
found here should be ready to use in Kolibri.Added (05/26/2017):