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

Make alcotest-lwt compatible with jsoo #348

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hhugo
Copy link
Contributor

@hhugo hhugo commented Mar 2, 2022

No description provided.

@hhugo
Copy link
Contributor Author

hhugo commented Apr 28, 2022

gentle ping

@craigfe craigfe self-assigned this Apr 29, 2022
@craigfe
Copy link
Member

craigfe commented Apr 29, 2022

Thanks @hhugo. I'll review this (& go through backlog elsewhere) this weekend 👍

Copy link
Member

@TheLortex TheLortex left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

The changes are making sense to me. However I'm afraid of the breaking changed introduced by the removal of the lwt.unix dependency. I'll try to investigate and see which packages are involved.

I have added a comment about alcotest_test_helper, we should explain somewhere why it is used instead of Lwt_main.run.

Can you rebase on top of main and add a changelog entry ?

@@ -7,5 +7,4 @@
fmt
alcotest.engine
alcotest
(re_export lwt.unix) ;; Unused dependency added for convenience to consumers
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a breaking change.. I don't know how many packages depend on lwt.unix being re-exported though.

@@ -5,11 +5,11 @@ let free () =
let test_lwt switch () =
Lwt_switch.add_hook (Some switch) free;
Lwt.async (fun () -> failwith "All is broken");
Lwt_unix.sleep 10.
Copy link
Member

Choose a reason for hiding this comment

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

What was the reason for this 10 seconds sleep ?

@@ -0,0 +1,7 @@
let rec wakeup_until_resolved p =
Copy link
Member

Choose a reason for hiding this comment

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

It should be explained somewhere that to make the tests work with js we use a custom lwt event loop.
Either in CONTRIBUTING.md or in alcotest_test_helper.ml.

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.

None yet

3 participants