Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AlexStroke
Copy link
Contributor

Description

Linked issue

Closes #{issue_number}

Benefits

Checklist

  • I've read CONTRIBUTING.md
  • I've used the standard signed-off commit format (or will squash just before merging)
  • All applicable CI checks pass (or I promised to make them pass later)
  • (optional) I've written unit tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Mar 4, 2024
@AlexStroke AlexStroke changed the title [refactor] Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps #4039 [refactor] #4039 Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps Mar 4, 2024
@AlexStroke AlexStroke changed the title [refactor] #4039 Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps [refactor] #4039: Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps Mar 4, 2024
@github-actions github-actions bot added the Refactor Improvement to overall code quality label Mar 4, 2024
@AlexStroke AlexStroke force-pushed the astrokov-iroha2-dev branch 2 times, most recently from 5ea7ac1 to 8415604 Compare March 11, 2024 08:24
@coveralls
Copy link
Collaborator

coveralls commented Mar 11, 2024

Pull Request Test Coverage Report for Build 8555785955

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5346 unchanged lines in 95 files lost coverage.
  • Overall coverage increased (+0.9%) to 57.676%

Files with Coverage Reduction New Missed Lines %
primitives/src/conststr.rs 1 91.14%
crypto/src/hash.rs 1 73.78%
ffi/derive/src/convert.rs 1 84.45%
primitives/src/lib.rs 1 0.0%
core/src/sumeragi/network_topology.rs 1 98.78%
primitives/src/must_use.rs 2 74.29%
crypto/src/signature/bls/mod.rs 2 0.0%
config/src/snapshot.rs 3 78.57%
data_model/derive/src/has_origin.rs 3 95.16%
config/src/kura.rs 3 80.0%
Totals Coverage Status
Change from base Build 7884695009: 0.9%
Covered Lines: 23491
Relevant Lines: 40729

💛 - Coveralls

@AlexStroke AlexStroke force-pushed the astrokov-iroha2-dev branch 2 times, most recently from 5f7c05f to 9d7e59d Compare March 11, 2024 12:46
@AlexStroke AlexStroke force-pushed the astrokov-iroha2-dev branch 2 times, most recently from f2176fa to e97b9ba Compare March 12, 2024 13:18
self.threads = []
for port in peers_ports:
self.config.update_torii_url(port)
thread = threading.Thread(target=self.listen_to_events, args=(port,))
Copy link
Contributor

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:
Copy link
Contributor

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.

Comment on lines +85 to +88
if config_path in self.event_data:
self.event_data[config_path] += output
else:
self.event_data[config_path] = output
Copy link
Contributor

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:

Suggested change
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

client_cli/pytests/src/client_cli/client_cli.py Outdated Show resolved Hide resolved
self.transaction_status = {}
self.threads = []
for port in peers_ports:
self.config.update_torii_url(port)
Copy link
Contributor

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.

Copy link

github-actions bot commented May 3, 2024

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:

No release type found in pull request title "[refactor] #4039: Enhance ClientCli Wait Mechanism for Transaction Completion in pytests and Remove Fixed Sleeps ". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

Signed-off-by: alexstroke <111361420+astrokov7@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants