edge: running-sweep tests are Linux only
2 files changed,
+15
−12
internal/edge/static_periodic_sweep_test.go+4 −12internal/edge/static_sweep_test.go+11 −0
CI failed — run details
diff --git a/internal/edge/static_periodic_sweep_test.go b/internal/edge/static_periodic_sweep_test.go| index fff4e7c7f..440942c22 100644 |
| --- a/internal/edge/static_periodic_sweep_test.go |
| +++ b/internal/edge/static_periodic_sweep_test.go |
| @@ -1,4 +1,7 @@ |
| -//go:build unix |
| +//go:build linux |
| + |
| +// Running sweeps need the record lock, which only Linux has |
| +// (static_recordlock_linux.go). |
| package edge |
| @@ -18,15 +21,6 @@ import ( |
| "github.com/carlosframework/platform/internal/release" |
| ) |
| -// madeCurrentAt dates a tree the way pointCurrent does: its mtime is when it |
| -// last became an app's current tree. |
| -func madeCurrentAt(t *testing.T, cache, acct, app, name string, at time.Time) { |
| - t.Helper() |
| - if err := os.Chtimes(filepath.Join(cache, acct, app, name), at, at); err != nil { |
| - t.Fatal(err) |
| - } |
| -} |
| - |
| // openTrees is a started edge's view of cache: the startup sweep has run |
| // (the lock file existed, so this start was allowed to sweep). |
| func openTrees(t *testing.T, cache string) *staticTrees { |
| @@ -41,8 +35,6 @@ func openTrees(t *testing.T, cache string) *staticTrees { |
| return tr |
| } |
| -func joined(t *testing.T, dir string) string { return strings.Join(entries(t, dir), "|") } |
| - |
| // The 2026-11-08 annie outage: the edge ran for a day while eight apt |
| // releases shipped, and only a restart swept. A running edge now sweeps by |
| // itself, keeping each app's current tree, the one current before it, and |
diff --git a/internal/edge/static_sweep_test.go b/internal/edge/static_sweep_test.go| index d980597e7..7a98ac8bc 100644 |
| --- a/internal/edge/static_sweep_test.go |
| +++ b/internal/edge/static_sweep_test.go |
| @@ -43,6 +43,17 @@ func seenLock(t *testing.T, cache string) { |
| } |
| } |
| +// madeCurrentAt dates a tree the way pointCurrent does: its mtime is when it |
| +// last became an app's current tree. |
| +func madeCurrentAt(t *testing.T, cache, acct, app, name string, at time.Time) { |
| + t.Helper() |
| + if err := os.Chtimes(filepath.Join(cache, acct, app, name), at, at); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +func joined(t *testing.T, dir string) string { return strings.Join(entries(t, dir), "|") } |
| + |
| func entries(t *testing.T, dir string) []string { |
| t.Helper() |
| es, err := os.ReadDir(dir) |