Skip to content

Add eventually utility - #1162

Open
bdmendes wants to merge 7 commits into
scalameta:mainfrom
bdmendes:eventually
Open

Add eventually utility#1162
bdmendes wants to merge 7 commits into
scalameta:mainfrom
bdmendes:eventually

Conversation

@bdmendes

Copy link
Copy Markdown
Contributor

Hi! As discussed in #1161, here's a proposal for eventually. Some things to think about:

  • I have experimented with an effect agnostic version that did munitValueTransform(body) and returned a Future. However, that wouldn't work for sync assertions before the end of a test example, and wouldn't return composable effect types for the interested downstream effect adapter libraries.
  • I don't think we have a way to sleep on JS for the synchronous case. Am I missing something?
  • The type implementations catch all exceptions and retry, not only assertion failures. This makes it very simple to e.g. skip transient failures on a Future and only map on the happy value. I understand this is opinionated, let me know what you think (vs. only catching munit assertion failures).
  • The stack trace on failures is very long (recursive retries). Should we clean it up and filter the retry calls?

I am open to all kinds of suggestions.

@tgodzik

tgodzik commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Looks like a sensible addition to me, but maybe we should ask for more opinions? I can raise it on Scala contributors and discord to get more eyes on it. What do you think?

@tgodzik

tgodzik commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The stack trace on failures is very long (recursive retries). Should we clean it up and filter the retry calls?

One way hand yes, but I find tinkering with stack trace might cause more issues and is a bit magical.

@bdmendes

Copy link
Copy Markdown
Contributor Author

I can raise it on Scala contributors and discord to get more eyes on it

Sure, let's try to find some common ground. Can you point me to the Scala Contributors thread/Discord where the discussion happens? I am happy to keep an eye on those and in this PR's thread.

@tgodzik

tgodzik commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

I've posted on the general Scala Discord and on Scalameta one. I think ideally people would comment here.

I just wanted some additional opinions, since I mostly maintain munit in a minimal capacity 😓 (didn't work on the library to extensively)

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