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
[refactor] #4039: Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps #4340
base: main
Are you sure you want to change the base?
Conversation
5ea7ac1
to
8415604
Compare
Pull Request Test Coverage Report for Build 8555785955Details
💛 - Coveralls |
5f7c05f
to
9d7e59d
Compare
f2176fa
to
e97b9ba
Compare
self.threads = [] | ||
for port in peers_ports: | ||
self.config.update_torii_url(port) | ||
thread = threading.Thread(target=self.listen_to_events, args=(port,)) |
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.
listen_to_events
expects config_path
but you are passing port
here, looks suspicious
output = process.stdout.readline() | ||
if not output: | ||
break | ||
with self.event_data_lock: |
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 don't think you need a lock here, python dict
is thread-safe due to GIL.
if config_path in self.event_data: | ||
self.event_data[config_path] += output | ||
else: | ||
self.event_data[config_path] = output |
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.
Instead of default dict you can use deafultdict(str)
here, this way code could be simplified:
if config_path in self.event_data: | |
self.event_data[config_path] += output | |
else: | |
self.event_data[config_path] = output | |
self.event_data[config_path] += output |
self.transaction_status = {} | ||
self.threads = [] | ||
for port in peers_ports: | ||
self.config.update_torii_url(port) |
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 part looks like every thread will see only latest call to update_torii_url
.
e97b9ba
to
86a0908
Compare
86a0908
to
ec18d4f
Compare
ec18d4f
to
3a9206f
Compare
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification, and it looks like your proposed title needs to be adjusted. Details:
|
Signed-off-by: alexstroke <111361420+astrokov7@users.noreply.github.com>
2865335
to
51556c5
Compare
Description
Linked issue
Closes #{issue_number}
Benefits
Checklist
CONTRIBUTING.md