Skip to content

Commit 7f13daa

Browse files
committed
fix: clean up runtime shutdown on early cancel
1 parent ed1976c commit 7f13daa

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

cmd/gc/city_runtime.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ func (cr *CityRuntime) crashTrack() crashTracker {
204204
// the per-city main loop — it watches config, reconciles agents, runs
205205
// wisp GC, and dispatches orders.
206206
func (cr *CityRuntime) run(ctx context.Context) {
207+
defer cr.shutdown()
208+
207209
dirty := &atomic.Bool{}
208210
if cr.tomlPath != "" {
209211
watchPaths := append([]string{}, cr.watchDirs...)

test/acceptance/skill_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// Skill command acceptance tests.
44
//
5-
// These exercise gc skill as a black box: listing available topics
6-
// and displaying individual topic references.
5+
// These exercise gc skills as a black box: listing available built-in
6+
// topics and displaying individual topic references.
77
package acceptance_test
88

99
import (
@@ -15,27 +15,27 @@ import (
1515

1616
func TestSkillCommands(t *testing.T) {
1717
t.Run("ListTopics", func(t *testing.T) {
18-
out, err := helpers.RunGC(testEnv, "", "skill")
18+
out, err := helpers.RunGC(testEnv, "", "skills")
1919
if err != nil {
20-
t.Fatalf("gc skill failed: %v\n%s", err, out)
20+
t.Fatalf("gc skills failed: %v\n%s", err, out)
2121
}
2222
if strings.TrimSpace(out) == "" {
23-
t.Fatal("gc skill produced empty output")
23+
t.Fatal("gc skills produced empty output")
2424
}
2525
})
2626

2727
t.Run("WorkTopic", func(t *testing.T) {
28-
out, err := helpers.RunGC(testEnv, "", "skill", "work")
28+
out, err := helpers.RunGC(testEnv, "", "skills", "work")
2929
if err != nil {
30-
t.Fatalf("gc skill work failed: %v\n%s", err, out)
30+
t.Fatalf("gc skills work failed: %v\n%s", err, out)
3131
}
3232
if strings.TrimSpace(out) == "" {
33-
t.Fatal("gc skill work produced empty output")
33+
t.Fatal("gc skills work produced empty output")
3434
}
3535
})
3636

3737
t.Run("UnknownTopic", func(t *testing.T) {
38-
_, err := helpers.RunGC(testEnv, "", "skill", "nonexistent-topic-xyz")
38+
_, err := helpers.RunGC(testEnv, "", "skills", "nonexistent-topic-xyz")
3939
if err == nil {
4040
t.Fatal("expected error for unknown skill topic")
4141
}

0 commit comments

Comments
 (0)