fix: [sc-85690] Auto updater integration test#39
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Story details: https://app.shortcut.com/rewst/story/85690
Changes
Auto updater integration test (
scripts/build_integration_test.ps1,.github/workflows/integration-test.yml)scripts/build_integration_test.ps1— builds a special integration test binary using-ldflagsto inject a fake version (v0.0.0-it, older than any real release) and a short update interval (30s) to force an auto update during the testbuild-integration-testjob in the CI workflow that builds and caches the IT binary per platform usingactions/cache@v5(keyed on Go version + source hash)--update"Updating agent"appears (up to 120s)0.0.0-itUpdate interval override (
internal/agent/updater.go)updateIntervalStrpackage-level variable, injectable at build time via-ldflagsDefaultUpdateInterval()which readsupdateIntervalStrif set, otherwise defaults to 48 hoursservice.goupdated to useDefaultUpdateInterval()instead of a hardcoded48*time.HourExecutable permission fix (
internal/agent/updater.go)os.Chmod(file.Name(), 0755)after downloading the installer binary toos.CreateTemp— without this,execfails withpermission deniedon Unix since temp files are created without execute bitsDetached process launch (
cmd/agent_smith/run_command_unix.go,run_command_windows.go)cmd.Start()(non-blocking), but it was inheriting the service's process group — causing it to be killed when the service shut down as part of the update handoffdetachedCommand():syscall.SysProcAttr{Setsid: true}— creates a new session, fully detaching from the parent process groupCreationFlags: syscall.CREATE_NEW_PROCESS_GROUP— equivalent detachment for the Windows process modelTest plan
os: allbuild-integration-testjob completes and artifacts are uploaded for all three platforms"Updating agent"within 120s on each platform0.0.0-it