Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
marked this pull request as ready for review
October 15, 2026 19:20
This was referenced Oct 15, 2026
…r tests compile (#971)
…ts (#971) cmd/spored (real bug): buildStatusReport read uptime BEFORE the CPU/network samples and "now" after them, so boot and billed time were late by the sampling time — seconds on Windows, where each sample is a PowerShell process (47s after launch reported 52s billed). And on the checkpoint path (always on Windows, which publishes no compute clock) compute included the status process's own run time, so it read "2s as of the last checkpoint" with no checkpoint written. Clock readings now follow the samples, and an unadopted clock reports exactly the checkpoint. The tests bound times by a before/after window instead of assuming the report is instant; verified to fail against the old code with a simulated 2.5s sampling delay. pkg/agent: the /sys/class/net fixture used kernel-style names with ':', which Windows rejects; the parser never reads them, so use '-'. lambda/pipeline-orchestrator (part of the root module, no go.mod) and pkg/taskproto: tests that execute Linux user-data / wrapper / flush hook under bash are skipped on Windows (#1002).
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…1023's plugin order (#1007) The sandboxed bootstrap tests execute the Linux user data under bash with stubbed spored and su, which the Windows CI job (#973) cannot reproduce, so they skip there as the other Linux-bootstrap execution tests do (#1002). Rebased onto #1023/#1045, plugins.json is written before spored starts, so the post-spored stop sits straight after the bootstrap body; the changelog and the ordering test's comment now say so. (#1007)
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…1023's plugin order (#1007) The sandboxed bootstrap tests execute the Linux user data under bash with stubbed spored and su, which the Windows CI job (#973) cannot reproduce, so they skip there as the other Linux-bootstrap execution tests do (#1002). Rebased onto #1023/#1045, plugins.json is written before spored starts, so the post-spored stop sits straight after the bootstrap body; the changelog and the ordering test's comment now say so. (#1007)
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…1021) * Stop a Spot replacement from re-running the user's workload (#1007) A replacement EC2 launches from a leaked persistent Spot request boots the original's user data. The bootstrap started --command in the background before spored, so the replacement re-ran the workload from the start, side effects included, while spored was deciding to retire it. New `spored is-spot-replacement` runs spotrequest.DetectReplacement and exits 0 (replacement), 1 (not) or 2 (unknown). It retries an inconclusive read every 5s for up to --timeout (60s), and not at all on an IAM refusal. The Linux bootstrap calls it twice through spawn_is_spot_replacement: inside the backgrounded --command subshell, ahead of the command, so it never delays spored's start; and right after spored starts, where a replacement exits the script. So storage, plugins, the container, custom user data and the MPI, batch-queue and pool-worker scripts appended later don't run either. Definite answers are cached in /run/spawn. Only exit 0 skips. Unknown, a missing spored, an older spored without the subcommand (cobra exits 1) and a timeout all run the workload, as before. Holding would strand originals whenever EC2/IMDS is slow or a custom role can't read tags; a replacement that gets past it is still retired by spored and alarmed by the reaper. The Windows bootstrap starts no workload (it runs no --command or user data), so it has nothing to gate; a comment says what to do if it gains one. Also adds TestRunDaemonStartsTheReplacementCheck, which fails if runDaemon stops starting the #995 check (the gap #1008 noted), and a Detection.Err field so the subcommand can tell an IAM refusal from a transient failure. The bootstrap tests run the generated --command block and the post-spored tail under bash with stubbed spored and su; each new test was watched failing against a compiling revert. (#1007) * Run the post-spored replacement stop after the plugin declarations (#1007) spored reads /etc/spawn/plugins.json once, at startup, and the bootstrap writes it just after `systemctl start spored`. Putting the stop's EC2 round trip between the two would have made spored miss the declarations on every original instance. The stop now follows the plugins block; a gate keeps it there. The existing race is filed as #1023. (#1007) * Name the original instance in spot_replacement_retired (#1007) The notification comes from the replacement, whose instance id nobody registered with spore-bot, so the bot's registration gate dropped every DM and SMS for it. spored now also sends original_instance_id (via Notifier.WithOriginalInstance), which spore-bot uses for this event alone. Older bots ignore the unknown field. (#1007) * Skip the bash-run Spot replacement bootstrap tests on Windows; note #1023's plugin order (#1007) The sandboxed bootstrap tests execute the Linux user data under bash with stubbed spored and su, which the Windows CI job (#973) cannot reproduce, so they skip there as the other Linux-bootstrap execution tests do (#1002). Rebased onto #1023/#1045, plugins.json is written before spored starts, so the post-spored stop sits straight after the bootstrap body; the changelog and the ordering test's comment now say so. (#1007) * Use the repo's bare nosemgrep on the spot-replacement test harness (#1007)
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…; stop's TTL message (#928) (#947) * Answer status for stopped instances from EC2, keep compute across stop/start, fix the TTL-pause message (#928) - status: a non-running instance is rendered from EC2 data and tags (state, stopped since and why, TTL deadline, compute and cost so far, EBS accruing while stopped). No SSH or SSM. A running instance with no public IP uses SSM. - pkg/sshtarget: every ssh/scp client starts through one guard that refuses empty, loopback and unspecified hosts (destination, -J, scp operands). A gate fails the build on any ssh/scp exec elsewhere, wrappers included. - spored: durable compute checkpoint on the root volume, written every tick and first on shutdown. The compute-seconds tag flush is retried and logged. Each boot counts from kernel boot without double-counting a same-boot restart. A restarted instance's billed time excludes the stop. - stop/hibernate/start: say the TTL deadline still applies (local time with UTC). start no longer overwrites spawn:ttl. Help text and docs-gen agree, and that agreement is gated. - pkg/aws: InstanceInfo.StateReason (additive; api snapshot updated). (#928) * Test: measure the restarted-instance compute against a window, not an instant Sampling in buildStatusReport takes seconds on Windows, so the 91-94s bound flaked there (95s). Same window pattern as TestStatusReport_QueryCountsTheDaemonsRunningTime (#973). (#928)
This was referenced Oct 19, 2026
Closed
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.
Fixes #971. Also fixes #997, #998 and #999, three real Windows bugs the new job found.
The job
test-windows(Test (Windows)) runs onwindows-latest. It uses the same SHA-pinnedactions/checkout/actions/setup-goand Go1.26.9as the other jobs, and runsscripts/windows-tests.sh, which isgo test -short -count=1over every root-module package except those inscripts/windows-test-skips.txt. The list is inverted on purpose: a new package is tested on Windows by default and has to be written down to escape. Each skip carries a reason and an issue.AWS_EC2_METADATA_DISABLED=true(not a credential), so a test that reaches for AWS fails fast instead of probing the runner's IMDS.core.autocrlf=true. Under CRLF, about a dozen hygiene tests (repo-root finders matching"module ...\n", the ps1 golden file) failed for a reason no Windows user would see, so the job checks out with LF.pkg/service,pkg/taskproto: their tests do not compile on Windows (Two test files don't compile for GOOS=windows (syscall.Stat_t, SysProcAttr.Setpgid); no gate vets non-default GOOS #925), and Make the test suite compile for Windows, and vet every release GOOS (#925) #941 fixes that. Once Make the test suite compile for Windows, and vet every release GOOS (#925) #941 merges, delete both lines;TestWindowsSkipListIsJustifieddoes not detect that.pkg/security(security: path validators are POSIX-only, so on Windows ValidatePathForReading denies nothing #1000): the path validators are POSIX-only. On WindowsValidatePathForReadingdenies nothing.pkg/pluginruntime(pluginruntime: plugin remote steps run via sh/su/tar, so a Windows spore cannot run them #1001): plugin steps run viash/su/tar, which a Windows spore lacks.Gates (
windows_ci_test.go)TestCIRunsUnitTestsOnWindows: a ci.yml job has a Windowsruns-onand invokes the script at command position, so anechothat names it does not count, and nothing setscontinue-on-error. The script runsgo test -shortover the discovered packages and reads the skip list.TestWindowsCIJobHasNoAWS: no AWS credential or profile env var, and nosecrets.*, at workflow, job or step level, and noconfigure-aws-credentials.TestWindowsSkipListIsJustified: every skip cites#NNNand names a real package.TestWindowsJobRunsWindowsOnlyTests: this is the anti-vacuity gate. It walks the root module and discovers_test.gofiles that build on windows but not on linux, by_windowsfilename suffix or by evaluating//go:buildwithgo/build/constraint. It fails if it finds none, and fails if any of them sits in a skipped package.pkg/agentandcmd/sporedmay never be skipped. It currently findspkg/agent/sys_windows_test.goand the newpkg/plugin/registry_windows_test.go.I watched each gate fail against a compiling revert:
runs-on: ubuntu-latest,run: echo scripts/windows-tests.sh, anAWS_ACCESS_KEY_ID: ${{ secrets.X }}step env,pkg/agentadded to the skip list, an entry with no issue and a nonexistent package,go vetsubstituted forgo test, andsys_windows_test.goremoved. I also renamed that file to drop the_windowssuffix, and it was still discovered through its//go:build windowsline.Real Windows bugs, fixed here
plugin.ParseRefonly recognised./,../and/, sospawn plugin inspect C:\x.yamlor.\x.yamlwas looked up in the registry over the network. The test made a live GitHub call from CI. Fixed, with a Windows-only test.filepath.Match. On Windows*crosses/, so nested objects were pulled. It now usespath.Match, and absolute-pattern output keys areToSlashed.PrepareSnapshotImage's raw-imageCleanupwas a no-op, and the only caller calls onlyCleanup. The file or S3 body leaked, and on Windows the file stayed locked. The test now assertsos.ErrClosedafter Cleanup, and it fails against the revert.Test-only fixes
HOMEalone does not move the home directory on Windows, whereos.UserHomeDirreadsUSERPROFILE. Tests incmdandpkg/configread the runner's real profile. AsetTestHomehelper sets both. On a developer's Windows machine those tests would have read their real~/.spawn.TestWriteOutputIDwrote to a literal/tmp, which on Windows createdC:\tmp. It now usest.TempDir().dcv.baton Windows, found throughPATHEXT, so the production exec path runs. The plugin env-passthrough steps use slash paths undersh. The platform path asserts compare in slash form. The service-upload test takes the OS's own not-found text.Skipped on Windows, Linux-only by design (#1002)
These tests execute the Linux user-data, installer, pool-worker or task-flush shell, or assert POSIX mode bits. They are in pkg/agent (task-flush hook), arrayrec, cmd (pool worker loop, audit.log mode), launcher, sporedinstall (shell installer), taskpool and userdata (MPI block). Each skip message cites #1002.
Caveats
ci.ymlwith Make the test suite compile for Windows, and vet every release GOOS (#925) #941 (GOOS vet gate), Make integration-tagged tests compile, and gate every build tag (#913) #927 (build-tag gate) and Make staticcheck blocking in make check and CI, and fix its 67 findings (#923) #938 (staticcheck). They add steps to thetestjob, and this adds a new job after it, so keep both sides. When Make the test suite compile for Windows, and vet every release GOOS (#925) #941 lands, drop the two Two test files don't compile for GOOS=windows (syscall.Stat_t, SysProcAttr.Setpgid); no gate vets non-default GOOS #925 lines from the skip list.