-
Notifications
You must be signed in to change notification settings - Fork 0
[WRONG BRANCH] fix(lab): restore automation scheduler intent on restart #268
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -380,6 +380,12 @@ describe("CL-08 lab automation", () => { | |
| } | ||
| }); | ||
|
|
||
| test("server startup reads scheduler intent from the committed automation config", () => { | ||
| const src = readFileSync(join(process.cwd(), "src/server/index.ts"), "utf8"); | ||
| expect(src).toContain("loadLabAutomationConfig(labConfigDir).policy.enabled"); | ||
| expect(src).not.toContain("loadLabAutomationPolicy(labConfigDir).enabled"); | ||
|
Comment on lines
+383
to
+386
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This test only checks that a particular string appears in the source; it never writes an enabled combined config, starts the server, or verifies that the scheduler is running, so it would still pass if the loader or scheduler became a no-op and the restart regression returned. Add a behavioral test through a startup seam or live server that covers both an enabled committed config and a disabled committed config with stale legacy policy. AGENTS.md reference: AGENTS.md:L231-L233 Useful? React with 👍 / 👎. |
||
| }); | ||
|
|
||
| test("corrupt scheduler state fails closed on load", () => { | ||
| withHome((home) => { | ||
| const path = join(home, "lab"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
automation-config.jsonis malformed or its lock cannot be acquired,loadLabAutomationConfigthrows here afterBun.servehas already bound the public listener and after the startup rollback block has ended. The caller receives no server handle to stop, leaving the listener and associated resources alive so a retry can fail with an address conflict; load the intent before binding or include this post-bind initialization in the existing rollback transaction.Useful? React with 👍 / 👎.