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

feat: allow multiple devimint clients with the same name #4193

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

maan2003
Copy link
Member

@maan2003 maan2003 commented Jan 31, 2024

allow you to run latency tests twice on same test dir for example

@maan2003 maan2003 requested a review from a team January 31, 2024 19:30
@maan2003 maan2003 marked this pull request as ready for review January 31, 2024 19:30
@maan2003 maan2003 requested a review from a team as a code owner January 31, 2024 19:30
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (master@32e5994). Click here to learn what that means.
Report is 14 commits behind head on master.

❗ Current head 972c2bd differs from pull request most recent head 6d3e48c. Consider uploading reports for the commit 6d3e48c to get more accurate results

Files Patch % Lines
devimint/src/federation.rs 0.00% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4193   +/-   ##
=========================================
  Coverage          ?   57.81%           
=========================================
  Files             ?      197           
  Lines             ?    43427           
  Branches          ?        0           
=========================================
  Hits              ?    25109           
  Misses            ?    18318           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpc
Copy link
Contributor

dpc commented Jan 31, 2024

allow you to run latency tests twice on same test dir for example

Is this fundamentally sound? Two tests using same client at the same time seems like asking for trouble.

@maan2003
Copy link
Member Author

maan2003 commented Feb 1, 2024

it is not same client though, second one uses a different client dir. (foo-1)

@maan2003
Copy link
Member Author

maan2003 commented Feb 1, 2024

it lets you do

latency_test(dev_fed).await;
latency_test(dev_fed).await;

currently it error that client dir already exists

elsirion
elsirion previously approved these changes Feb 1, 2024
Copy link
Contributor

@elsirion elsirion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clever!

}

/// Open or create a [`Client`] that starts with a fresh state.
pub async fn open_or_create(name: &str) -> Result<Client> {
let client = Self {
name: name.to_owned(),
name: format!("{name}-0"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need for this function now, as create work like it: it can't fail if the dir already exists. Also - since it doesn't go through the lock, it would be racy with crate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now removed

@dpc
Copy link
Contributor

dpc commented Feb 2, 2024

OK. Makese sense and looks correct. :)

dpc
dpc previously approved these changes Feb 5, 2024
elsirion
elsirion previously approved these changes Feb 5, 2024
@justinmoon
Copy link
Contributor

What's status here?

@maan2003
Copy link
Member Author

now CI is passing

@maan2003 maan2003 added this pull request to the merge queue Feb 27, 2024
Merged via the queue into fedimint:master with commit 73f8871 Feb 28, 2024
20 checks passed
@maan2003 maan2003 deleted the multi-client-devimint branch February 28, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants