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

fixups for directory by listener #8

Conversation

nothingmuch
Copy link

@nothingmuch nothingmuch commented Nov 29, 2024

the problem was that redis was being shut down prematurely, see long commit message of final fixup commit

different fixes are separated into different commits at your discretion:

  1. avoid mixing blocking and tokio listeners, and listen on [::] instead of 0.0.0.0 in line with previous behavior
  2. whitespace fixes
  3. hideous fix for the docker stuff

i didn't bother making 3 pretty since the commit i was ammending seemed quite WIP, this needs some finessing since db borrows from docker and both must persist, so i just copypasted that boilerplate into all of the tests that call init_directory to make them work

this seems to be working well now, but i never observed the flakiness myself so not sure how much that counts for

ensure that the db: testcontainer::Container variable does not go out of scope while the directory is running.

previously the directory task itself was awaited on by init_directory, whereas in the modified code it is instead returned as part of the result due to the different return value of listen_tcp_with_tls_on_free_port. this indirection de-coupled the db variable's lifetime from that of the directory, allowing it to go out of scope earlier than expected.
@DanGould
Copy link
Owner

@spacebear21 incorporated this into payjoin#388

@DanGould DanGould closed this Dec 30, 2024
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.

2 participants