-
Notifications
You must be signed in to change notification settings - Fork 27
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
bugfix: fix initialization order bugs #550
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
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.
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_THREAD I 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_settings
before it was called byrun_node
with the correct configuration, therefore generating aloading config twice with a different file
error.HathorManager
was sending events relevant to theEventManager
before starting it.