Conversation
Codecov Report
@@ Coverage Diff @@
## dev #550 +/- ##
=======================================
Coverage 83.19% 83.19%
=======================================
Files 211 211
Lines 18665 18665
Branches 2593 2593
=======================================
Hits 15528 15528
Misses 2565 2565
Partials 572 572 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ccdefd5 to
405bb58
Compare
jansegre
left a comment
There was a problem hiding this comment.
The cli import fix is good as is, about the other one I wonder if we should make a test for it.
@jansegre I was investigating this and I found out that existing tests in def publish(self, key: HathorEvents, **kwargs: Any) -> None:
reactor_thread = ReactorThread.get_current_thread(self.reactor)
args = EventArguments(**kwargs)
for fn in self._subscribers[key]:
if reactor_thread == ReactorThread.NOT_RUNNING:
fn(key, args)
else:
is_empty = bool(not self.queue)
self.queue.append((fn, key, args))
if is_empty:
self._schedule_call_next()The reason the tests passed is because tests use the Also, def get_current_thread(cls, reactor: Reactor) -> 'ReactorThread':
""" Returns if the code is being run on the reactor thread, if it's running already.
"""
running = getattr(reactor, 'running', None)
if running is not None:
if running:
return cls.MAIN_THREAD if isInIOThread() else cls.NOT_MAIN_THREAD
else:
# if reactor is not running yet, there's no threading
return cls.NOT_RUNNING
else:
# on tests, we use Clock instead of a real Reactor, so there's
# no threading. We consider that the reactor is running
return cls.MAIN_THREADI feel that we should somehow either change
What do you think? |
I think we should open an issue and investigate this separately and independently from this fix. I'd say this PR can me merged as is. |
I have created an issue: #552 |
405bb58 to
aa37ec3
Compare
a5ae79a to
80df581
Compare
80df581 to
406eb93
Compare
Acceptance Criteria:
get_settingsbefore it was called byrun_nodewith the correct configuration, therefore generating aloading config twice with a different fileerror.HathorManagerwas sending events relevant to theEventManagerbefore starting it.