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

Devimint use random ports #3247

Merged
merged 4 commits into from
Sep 30, 2023
Merged

Conversation

maan2003
Copy link
Member

@maan2003 maan2003 commented Sep 20, 2023

current status: everything works!

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Attention: 118 lines in your changes are missing coverage. Please review.

Comparison is base (086f4ba) 58.58% compared to head (9589584) 58.59%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3247       /-   ##
==========================================
  Coverage   58.58%   58.59%    0.01%     
==========================================
  Files         196      196              
  Lines       41599    41653       54     
==========================================
  Hits        24371    24408       37     
- Misses      17228    17245       17     
Files Coverage Δ
modules/fedimint-wallet-common/src/config.rs 73.49% <100.00%> ( 0.99%) ⬆️
devimint/src/federation.rs 0.00% <0.00%> (ø)
devimint/src/vars.rs 0.00% <0.00%> (ø)
devimint/src/bin/faucet.rs 0.00% <0.00%> (ø)
fedimintd/src/lib.rs 0.00% <0.00%> (ø)
devimint/src/main.rs 0.00% <0.00%> (ø)
fedimint-wasm-tests/src/lib.rs 0.00% <0.00%> (ø)
devimint/src/lib.rs 0.00% <0.00%> (ø)
devimint/src/external.rs 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

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

@maan2003 maan2003 force-pushed the devimint-random branch 7 times, most recently from dae6224 to dc8e99f Compare September 27, 2023 15:23
@@ -33,6 34,26 @@ pub struct Bitcoind {
impl Bitcoind {
pub async fn new(processmgr: &ProcessManager) -> Result<Self> {
let btc_dir = utf8(&processmgr.globals.FM_BTC_DIR);
let conf = format!(
"\
regtest=1
Copy link
Contributor

Choose a reason for hiding this comment

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

r#" ... "#'; raw strings might work better, possibly move to another file and include_str!(...); it anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

surprising that include_str! works with format!

FM_LOGS_DIR: PathBuf = mkdir(FM_TEST_DIR.join("logs")).await?;

FM_PORT_BTC_RPC: u16 = port_alloc(1)?;
Copy link
Contributor

@dpc dpc Sep 27, 2023

Choose a reason for hiding this comment

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

Note: port_alloc keeps the port pre-allocated for like 60 seconds. That how much time the app has to actually bind and use it (which will prevent port_alloc from using it further). For deviming I worry it might not be enough, so we could have another method that binds it for longer.

Copy link
Member Author

Choose a reason for hiding this comment

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

60s should be more than enough. devimint starts in <15s for me locally, and all port bindings happens even before that. 4x margin is good enough.

@maan2003 maan2003 force-pushed the devimint-random branch 4 times, most recently from 62ff67f to 2859752 Compare September 28, 2023 15:30
@dpc
Copy link
Contributor

dpc commented Sep 28, 2023

Is green? Do we land?

@maan2003
Copy link
Member Author

now green, and also running tests without isolation.
I want to test multiple times to make sure that I didn't add any flakiness.

@maan2003 maan2003 changed the title [wip] Devimint use random ports Devimint use random ports Sep 29, 2023
@maan2003 maan2003 marked this pull request as ready for review September 29, 2023 14:22
@maan2003 maan2003 requested review from a team as code owners September 29, 2023 14:22
Copy link
Contributor

@dpc dpc left a comment

Choose a reason for hiding this comment

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

🎉 🎉 🎉

@dpc dpc added this pull request to the merge queue Sep 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 29, 2023
@maan2003 maan2003 added this pull request to the merge queue Sep 30, 2023
Merged via the queue into fedimint:master with commit daf97d8 Sep 30, 2023
@maan2003 maan2003 deleted the devimint-random branch September 30, 2023 03:40
@tvolk131
Copy link
Member

tvolk131 commented Oct 2, 2023

Does this fix #3161?

@fedimint-backports
Copy link

Backport failed for releases/v0.1, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin releases/v0.1
git worktree add -d .worktree/backport-3247-to-releases/v0.1 origin/releases/v0.1
cd .worktree/backport-3247-to-releases/v0.1
git checkout -b backport-3247-to-releases/v0.1
ancref=$(git merge-base 086f4ba989c7914ccc3c207ff0bd35a03695252c 95895845a5d0b7da2806cc896e84f93f97876cf9)
git cherry-pick -x $ancref..95895845a5d0b7da2806cc896e84f93f97876cf9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants