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

Test suite takes a long time to run #291

Open
danielballan opened this issue Sep 20, 2023 · 0 comments
Open

Test suite takes a long time to run #291

danielballan opened this issue Sep 20, 2023 · 0 comments

Comments

@danielballan
Copy link
Member

As @dmgav mentioned yesterday, the unit tests take about 135 minutes to run. They split into three groups, to facility running each group in parallel in separate CI jobs of 45 minutes each.

I think it's worth evaluating this. More tests means more protection against accidental regressions. But it can also mean:

  1. Changes are resource-intensive because they may involve updating many tests.
  2. Development in general is resource intensive because the feedback loop is slow.

The trade-off is context dependent, but I have read that 10 minutes is a good target. Ophyd and Tiled tests run in 10 minutes. Bluesky (i.e. RunEngine) tests have crept up to 35 minutes; that may also need a closer look.

For a young project, it's especially important to be selective about what is tested and what is left flexible, open to future rethinking. Well chosen tests can protect against important regressions while keeping the weight (number, runtime, code size) of tests reasonable. Jim Pavarski made this point in a DOEpy lecture: it's like pinning a dead frog for study in a bio lab: want some ability to move the frog around, while keeping key points still. As an example, he mentioned that testing the exist formatting of a string repr, like this:

repr = f"CommJsonRpcError('{err_msg}', {err_code}, '{err_type}')"
assert ex.__repr__() == repr, "Error representation is printed incorrectly"

may be too strict and confining.

One possible approach, which @dmgav raised in conversation, is simply more parallelism---split the tests into more groups---which could reduce the wall time in CI. But I think the total runtime / weight of the test suite is of interest.

It may be that significant speed-ups could be made by avoiding starting real (i.e. networked servers) and subprocesses, which happens a lot in this test suite.

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

No branches or pull requests

1 participant