Skip to content

Lwt.dont_wait: a more local, more explicit Lwt.async - #820

Merged
raphael-proust merged 3 commits into
ocsigen:masterfrom
raphael-proust:dont-wait
Dec 7, 2020
Merged

raphael-proust merged 3 commits into
ocsigen:masterfrom
raphael-proust:dont-wait

Conversation

@raphael-proust

@raphael-proust raphael-proust commented Nov 21, 2020 •

Copy link
Copy Markdown
Collaborator

Fixes #819

This is an alternative to async/ignore_result with a more explicit exception handler.

Comment thread test/core/test_lwt.ml Outdated
!saw = Some Exception)
end;
]
let suites = suites @ [async_tests ; dont_wait_tests]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I recommend not accumulating two suites on one line, i.e. leave old line 1804 alone. The idea is to do the concatenation "locally" to each test suite, so that the concatenations don't get lost, and we don't accidentally stop running some tests when code is edited.

Comment thread test/core/test_lwt.ml Outdated
later (fun () -> !f_ran = true)
end;

test ~sequential:true "f raises" begin fun () ->

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test doesn't need to be sequential. That's probably a leftover from using async tests as a template, where the test corresponding to this one mutates the global async_exception_hook ref. This doesn't happen in dont_wait tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same goes for the other tests in this suite with ~sequential:true.

@aantron

aantron commented Nov 21, 2020

Copy link
Copy Markdown
Collaborator

#819

Change this to "Resolves #819" or "Fixes #819" to automatically close #819 when this PR is merged. Just listing the issue number only links to the issue. Furthermore, "Fixes #819" or similar changes the message GitHub prints in #819 for the back-link, making it clearer that this PR did close that issue to readers of #819.

@aantron

aantron commented Nov 21, 2020

Copy link
Copy Markdown
Collaborator

LGTM modulo test suite nits.

Comment thread src/core/lwt.mli Resolved
@aantron aantron added this to the 5.4.0 milestone Nov 25, 2020
@raphael-proust

Copy link
Copy Markdown
Collaborator Author

Rebased on master to check the CI. I'll squash-and-merge if it all goes well.

@raphael-proust
raphael-proust merged commit 460f97a into ocsigen:master Dec 7, 2020
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.

Dont_wait instead of ignore_result

3 participants