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

Optimize bluechictl-is-enabled test #975

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

mwperina
Copy link
Member

@mwperina mwperina commented Nov 4, 2024

To improve performance of bluechictl-is-enabled test we will skip
checking existing unit file, if we already checked a unit with the same
enablement status before, when we traverse over list of all existing
unit files.

Relates: #972
Signed-off-by: Martin Perina [email protected]

To improve performance of bluechictl-is-enabled test we will skip
checking existing unit file, if we already checked a unit with the same
enablement status before, when we traverse over list of all existing
unit files.

Relates: eclipse-bluechi#972
Signed-off-by: Martin Perina <[email protected]>
@coveralls
Copy link

Coverage Status

coverage: 83.141%. remained the same
when pulling aa04351 on mwperina:optimize-is-enabled-tests
into bad95d5 on eclipse-bluechi:main.

Copy link
Member

@mkemel mkemel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

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

In general LGTM

By using the list-unit-files feature, we rely on the state of the machine (container/vm/etc.) - so it might behave differently in our container vs multi-host setup. In addition, the list-unit-files is quite expensive and takes quite a while to complete.
Therefore I'd like to raise the question if it is really necessary to aim for checking all systemd unit file states or to "just" select a few and enforce these - e.g. create a quadlet file, do a reload and check if the file is "generated".

@mwperina
Copy link
Member Author

mwperina commented Nov 5, 2024

In general LGTM

By using the list-unit-files feature, we rely on the state of the machine (container/vm/etc.) - so it might behave differently in our container vs multi-host setup. In addition, the list-unit-files is quite expensive and takes quite a while to complete. Therefore I'd like to raise the question if it is really necessary to aim for checking all systemd unit file states or to "just" select a few and enforce these - e.g. create a quadlet file, do a reload and check if the file is "generated".

I used units from list-unit-files, because I haven't been able to find out a way to create services with all possible enablement statuses to make sure we simulate systemctl behavior as much as possible. So using list-unit-files we are currently checking services with following enablement statuses (at least on my laptop):

  • static
  • alias
  • disabled
  • enabled
  • indirect
  • enabled-runtime

And the manually we check for non-existent unit file.

So for now I'd merge the code to unblock slower platforms and later we can investigate better solution as a part of #976

@engelmi
Copy link
Member

engelmi commented Nov 5, 2024

I used units from list-unit-files, because I haven't been able to find out a way to create services with all possible enablement statuses to make sure we simulate systemctl behavior as much as possible. So using list-unit-files we are currently checking services with following enablement statuses (at least on my laptop):

* static
* alias
* disabled
* enabled
* indirect
* enabled-runtime

And the manually we check for non-existent unit file.

That was my previous point - it relies on the machine we run it on. In this list the states generated and transient are missing, for example. So it is not exhaustive. Because of this I am wondering if we are optimizing the wrong thing and if a more static approach with just a few state checks should be chosen - which doesn't need investigation, we'd just need to decide.

So for now I'd merge the code to unblock slower platforms and later we can investigate better solution as a part of #976

Sounds reasonable to me. Both, merging now or changing the approach, is fine.

@mwperina mwperina merged commit fe52750 into eclipse-bluechi:main Nov 5, 2024
22 checks passed
@mwperina mwperina deleted the optimize-is-enabled-tests branch November 5, 2024 11:57
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