Skip to content

refactor: drop the _sleep_once fixture - #122

Merged
tonyandrewmeyer merged 2 commits into
canonical:mainfrom
tonyandrewmeyer:rainy/107-drop-sleep-once-fixture
Sep 10, 2026
Merged

tonyandrewmeyer merged 2 commits into
canonical:mainfrom
tonyandrewmeyer:rainy/107-drop-sleep-once-fixture

Conversation

@tonyandrewmeyer

@tonyandrewmeyer tonyandrewmeyer commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

_sleep_once returns a closure that sleeps on its first call and does nothing after that. Its docstring explains the point: "This allows fixtures of the same scope to ensure a single sleep happens before teardown." There is only one such fixture now, juju_factory, and it calls it once in its own teardown, so there is nothing for the guard to guard against. The fixture is module-scoped too, so slept is recreated per module and can never be True when that one call happens.

Replace it with a plain time.sleep(_LOG_WAIT) at the call site. Same total sleep count, one, in the same place.

Fixes #107

@tonyandrewmeyer
tonyandrewmeyer marked this pull request as ready for review September 7, 2026 09:41
@tonyandrewmeyer
tonyandrewmeyer merged commit a6b9430 into canonical:main Sep 10, 2026
16 checks passed
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.

Drop redundant _sleep_once fixture

2 participants