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

Add Testing Utility for Swarm #100

Open
maennchen opened this issue Aug 25, 2018 · 6 comments
Open

Add Testing Utility for Swarm #100

maennchen opened this issue Aug 25, 2018 · 6 comments

Comments

@maennchen
Copy link

We recently changed a big part of the supervision of quantum (add job scheduler library) to swarm if it is used in a cluster.

One thing that was missing for us is a testing utility to make sure that the new callbacks for swarm actually work.

I implemented a really easy helper: https://github.com/quantum-elixir/quantum-core/pull/369/files#diff-51021d33872c9243af9315e6b3809e77

Would you be willing so add something like that (but more complete) to the library?

@bitwalker
Copy link
Owner

That'd be great!

@arjan
Copy link
Collaborator

arjan commented Sep 13, 2018

I'm 👍 , the question is where we would put this utility. Swarm.TestHelpers maybe? PRs welcome :-)

@maennchen
Copy link
Author

I think we should start by defining what those would contain.

Those are the things that come into my mind:

  • Help supervising multiple workers in ExUnit (since start_supervised doesn't work together well with workers that could stop / have the same modulename to start
  • Provide Utility to initiate Handoff
  • Provide Utility to initiate Conflict Resolution

@maennchen
Copy link
Author

BTW: I would also include a Swarm.TestCase that does two things:

  • Import all Test Helpers for convenience
  • "Warm Up" swarm in a setup block so that it is already fully ready before any tests start. This can help prevent some timeout issues.

With warming up I mean to block & wait until swarm is fully synced.

@arjan
Copy link
Collaborator

arjan commented Sep 13, 2018

Yes, well actually @bitwalker and I are planning to refactor all test cases to make Swarm setup more reliable and less work, using his https://github.com/bitwalker/ex_unit_clustered_case library. So maybe hold off doing anything big until this has settled.

@bitwalker
Copy link
Owner

Yeah, revisiting this after thinking on it a bit more, I think a lot of what we have planned with reworking the existing test suite covers the goals stated here. Namely, we would be in a position to test handoff and conflict resolution much more easily, amongst other things. The other big thing coming down the pipe is reworking Swarm to no longer be a singleton process, which would allow us to simulate some things in parallel when we don't need to spin up a cluster of nodes for that purpose.

I will leave this open for now though, and we can revisit once some of these changes are in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants