Skip to content

Make alcotest-lwt compatible with jsoo#348

Open
hhugo wants to merge 1 commit into
mirage:mainfrom
hhugo:alcotest-lwt-jsoo
Open

Make alcotest-lwt compatible with jsoo#348
hhugo wants to merge 1 commit into
mirage:mainfrom
hhugo:alcotest-lwt-jsoo

Conversation

@hhugo

@hhugo hhugo commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@hhugo

hhugo commented Apr 28, 2022

Copy link
Copy Markdown
Contributor Author

gentle ping

@craigfe craigfe self-assigned this Apr 29, 2022
@craigfe

craigfe commented Apr 29, 2022

Copy link
Copy Markdown
Member

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

@TheLortex TheLortex left a comment

Copy link
Copy Markdown
Member

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 ?

Comment thread src/alcotest-lwt/dune
fmt
alcotest.engine
alcotest
(re_export lwt.unix) ;; Unused dependency added for convenience to consumers

Copy link
Copy Markdown
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.

let test_lwt switch () =
Lwt_switch.add_hook (Some switch) free;
Lwt.async (fun () -> failwith "All is broken");
Lwt_unix.sleep 10.

Copy link
Copy Markdown
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
Copy Markdown
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.

@MisterDA

Copy link
Copy Markdown
Collaborator

@hhugo what's the status of this?

@hhugo

hhugo commented Nov 20, 2024

Copy link
Copy Markdown
Contributor Author

I don't have time to spend on this and no longer have a need for this at the moment. Feel free to close or takeover the PR

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.

4 participants