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

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

Merged
merged 3 commits into from
Dec 7, 2020

Conversation

raphael-proust
Copy link
Collaborator

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

Fixes #819

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

!saw = Some Exception)
end;
]
let suites = suites @ [async_tests ; dont_wait_tests]
Copy link
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.

later (fun () -> !f_ran = true)
end;

test ~sequential:true "f raises" begin fun () ->
Copy link
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
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
Copy link
Collaborator

aantron commented Nov 21, 2020

#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
Copy link
Collaborator

aantron commented Nov 21, 2020

LGTM modulo test suite nits.

@aantron aantron added this to the 5.4.0 milestone Nov 25, 2020
@raphael-proust
Copy link
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