Skip to content

Fix metabox (apt profile + daemon respawn) (BugFix)#866

Merged
kissiel merged 8 commits intomainfrom
metabox-improvements
Dec 7, 2023
Merged

Fix metabox (apt profile + daemon respawn) (BugFix)#866
kissiel merged 8 commits intomainfrom
metabox-improvements

Conversation

@kissiel
Copy link
Copy Markdown
Contributor

@kissiel kissiel commented Dec 4, 2023

Description

efe7665
The previous "on-failure" meant that sending a signal to agent (for instance SIGKILL) would completely terminate the agent and make systemd not restart it.
This is very bad for emulating agent crashes. Thus I'm proposing here to always do it.

50e3f43 and 33f5ecc
Make agents from snaps always respawn

Considering that Checkbox is a tool that's intended to be sometimes killed, it needs to always be brought back online (its agent).
Immediately this fixes the agent respawn metabox tests and goes in line with the changes being made to the auto agent respawn stories.

ec27e41

Remove apt-related pre-provisioning from lxd profiles in Metabox

This is an relic from the times when we wanted to improve container provisioning speed, but now, when testing from source we provision everything with a normal apt execution, so this can go away. Also this list had a potential to quickly go stale.

Testing

Tested with MB runs using an agent-killing scenario.

Hook25
Hook25 previously approved these changes Dec 4, 2023
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, agree

EDIT: makes me wonder, should we also change the deb and snap? they have the same strategy

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

If you want to change them all here, I'm fine with it but:

  • change the title of the PR
  • change also the deb service

Copy link
Copy Markdown

@yphus yphus left a comment

Choose a reason for hiding this comment

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

The service file provided by the checkbox-ng deb package also needs the same fix:
https://github.com/canonical/checkbox/blob/main/checkbox-ng/debian/checkbox-ng.service

@kissiel kissiel changed the title Restart agent properly in metabox (BugFix) Fix metabox (apt profile + daemon respawn) (BugFix) Dec 4, 2023
@kissiel
Copy link
Copy Markdown
Contributor Author

kissiel commented Dec 4, 2023

The service file provided by the checkbox-ng deb package also needs the same fix: https://github.com/canonical/checkbox/blob/main/checkbox-ng/debian/checkbox-ng.service

Updated in a3c509e

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (591e663) 35.70% compared to head (8b2e784) 35.70%.
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #866   +/-   ##
=======================================
  Coverage   35.70%   35.70%           
=======================================
  Files         303      303           
  Lines       34250    34250           
  Branches     5917     5917           
=======================================
  Hits        12230    12230           
  Misses      21458    21458           
  Partials      562      562           
Flag Coverage Δ
checkbox-ng 61.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Hook25
Hook25 previously approved these changes Dec 4, 2023
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, ty for updating them all!

yphus
yphus previously approved these changes Dec 4, 2023
Copy link
Copy Markdown

@yphus yphus left a comment

Choose a reason for hiding this comment

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

LGTM

@kissiel kissiel dismissed stale reviews from yphus and Hook25 via c8c0d99 December 5, 2023 10:33
Hook25
Hook25 previously approved these changes Dec 5, 2023
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, ty

yphus
yphus previously approved these changes Dec 5, 2023
Copy link
Copy Markdown

@yphus yphus left a comment

Choose a reason for hiding this comment

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

+1

@kissiel kissiel dismissed stale reviews from yphus and Hook25 via 3d83da9 December 6, 2023 17:53
@kissiel
Copy link
Copy Markdown
Contributor Author

kissiel commented Dec 6, 2023

I also removed the glxgears test that was silently failing before, but now it started failing properly and we really don't want to have it tested.

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, ty

The previous "on-failure" meant that sending a signal to agent (for
instance SIGKILL) would completely terminate the agent and make systemd
not restart it.
This is very bad for emulating agent crashes. Thus I'm proposing here to
`always` do it.
Considering that Checkbox is a tool that's intended to be sometimes
killed, it needs to always be brought back online (its agent).
Immediately this fixes the agent respawn metabox tests and goes in line
with the changes being made to the auto agent respawn stories.
This is an relic from the times when we wanted to improve container
provisioning speed, but now, when testing from source we provision
everything with a normal apt execution, so this can go away. Also this
list had a potential to quickly go stale.
@kissiel kissiel force-pushed the metabox-improvements branch from 3d83da9 to 8b2e784 Compare December 7, 2023 09:00
@kissiel kissiel merged commit 601f7ce into main Dec 7, 2023
@kissiel kissiel deleted the metabox-improvements branch December 7, 2023 09:04
binli pushed a commit to binli/checkbox that referenced this pull request Mar 22, 2024
* in metabox always restart the agent

The previous "on-failure" meant that sending a signal to agent (for
instance SIGKILL) would completely terminate the agent and make systemd
not restart it.
This is very bad for emulating agent crashes. Thus I'm proposing here to
`always` do it.

* make agents from snaps **always** respawn

Considering that Checkbox is a tool that's intended to be sometimes
killed, it needs to always be brought back online (its agent).
Immediately this fixes the agent respawn metabox tests and goes in line
with the changes being made to the auto agent respawn stories.

* always respawn deb-delivered checkbox agents

* remove some of the debs in the pre-provisioning from lxd profiles in Metabox
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.

3 participants