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(daemon): don't start/stop reaper is setup/teardown #279

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

benhoyt
Copy link
Contributor

@benhoyt benhoyt commented Aug 18, 2023

Currently the TestRebootHelper test fails intermittently with the following failure (example log):

daemon_test.go:773:
    c.Assert(err, IsNil)
... value *os.SyscallError = &os.SyscallError{Syscall:"wait", Err:0xa} ("wait: no child processes")

This is because we're running the reaper, but systemdModeReboot doesn't use or know about the reaper. So avoid starting/stopping the reaper in the setup and teardown; daemon.New and Daemon.Stop -- via the service manager) starts/stop it in any case. And set the FakeCommand withReaper flag to false here as the reaper isn't running there now.

Fixes #186

Currently the TestRebootHelper test fails intermittently with the
following failure:

daemon_test.go:773:
    c.Assert(err, IsNil)
... value *os.SyscallError = &os.SyscallError{Syscall:"wait", Err:0xa} ("wait: no child processes")

This is because we're running the reaper, but systemdModeReboot doesn't
use or know about the reaper. So avoid starting/stopping the reaper
in the setup and teardown; daemon.New and Daemon.Stop -- via the
service manager) starts/stop it in any case. And set the FakeCommand
withReaper flag to false here as the reaper isn't running there now.

Fixes canonical#186
@benhoyt benhoyt changed the title Use reaper to run shutdown command if reaper is running test(daemon): Don't start/stop reaper is setup/teardown Aug 18, 2023
@benhoyt benhoyt changed the title test(daemon): Don't start/stop reaper is setup/teardown test(daemon): don't start/stop reaper is setup/teardown Aug 18, 2023
@jnsgruk jnsgruk requested review from flotter and anpep August 18, 2023 09:00
Copy link
Member

@jnsgruk jnsgruk left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks :)

@jnsgruk jnsgruk merged commit fd34da1 into canonical:master Aug 18, 2023
13 checks passed
@benhoyt benhoyt deleted the fix-reaper-issue branch August 20, 2023 22:37
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.

Intermittent test failure: daemonSuite.TestRebootHelper
3 participants