Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/server/src/cloud/pinnedRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,15 @@ it.layer(NodeServices.layer)("prunePinnedRuntimes", (it) => {
const path = yield* Path.Path;
const { baseDir, versionsDir } = yield* setup(["1.0.0", "1.1.0"]);
const entry = path.join(versionsDir, "1.0.0", "t3");
yield* fs.copyFile("/bin/sleep", entry);
// Multicall coreutils (Ubuntu's uutils) refuse to run renamed, so copy Node instead.
yield* fs.copyFile(process.execPath, entry);
yield* fs.chmod(entry, 0o755);
const link = path.join(baseDir, "t3");
yield* fs.symlink(entry, link);
// Its argv names only the link, as with `t3 serve` run from PATH. Removing the link after
// spawning leaves the process's executable as the only reference.
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
yield* spawner.spawn(ChildProcess.make(link, ["30"]));
yield* spawner.spawn(ChildProcess.make(link, ["-e", "setTimeout(() => {}, 30_000)"]));
yield* fs.remove(link);

const removed = yield* prunePinnedRuntimes({ baseDir, keep: ["2.0.0"] }).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe("terminatePosixOwnedProcessTree", () => {
AcpSessionRuntime.resolveLinuxCgroupTargetCommand("grok", scratch, { PATH: undefined }),
).toBeUndefined();
expect(
AcpSessionRuntime.resolveLinuxCgroupTargetCommand("node", scratch, { PATH: undefined }),
AcpSessionRuntime.resolveLinuxCgroupTargetCommand("sh", scratch, { PATH: undefined }),
).toBeDefined();
expect(
AcpSessionRuntime.resolveLinuxCgroupTargetCommand("grok", scratch, {
Expand Down
6 changes: 6 additions & 0 deletions apps/server/src/testUtils/managedServiceEnv.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SERVICE_LAUNCHER_CONTEXT_ENV } from "../cloud/serviceProtocol.ts";

// Agents inside a managed T3 service inherit its home and launcher context; CI has neither.
for (const name of ["T3CODE_HOME", "T3_BOOT_SERVICE_UNIT", SERVICE_LAUNCHER_CONTEXT_ENV]) {
delete process.env[name];
}
5 changes: 4 additions & 1 deletion apps/server/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export default mergeConfig(
// Parallel sqlite/git/worktree/orchestration tests introduce load-sensitive flakes.
fileParallelism: false,
sequence: { sequencer: WeightedShardSequencer },
setupFiles: ["./src/testUtils/gitConfig.setup.ts"],
setupFiles: [
"./src/testUtils/gitConfig.setup.ts",
"./src/testUtils/managedServiceEnv.setup.ts",
],
hookTimeout: 120_000,
testTimeout: 120_000,
},
Expand Down
Loading