mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
Merge remote-tracking branch 'origin/master' into fix/runner-paid-matrix-integrity
* origin/master: chore(deps-dev): bump rollup from 4.62.4 to 4.63.1 (#12570) ci(runner): route paid matrix to AWS fleet (#12765) fix(paperclip-runner): emit turn.accepted before any terminal turn event (#12752) test(heartbeat): drain in-flight runs before native-isolation TRUNCATE (#12751) # Conflicts: # .github/workflows/runner-full-stack-e2e.yml # server/src/__tests__/heartbeat-direct-adapter-native-isolation.test.ts # tests/runner-e2e/README.md # tests/runner-e2e/SECURITY.md # tests/runner-e2e/workflow-security.test.ts
This commit is contained in:
commit
ec428113dc
9 files changed
+279
-142
No files matched your search
@@ -14,6 +14,7 @@ import {
|
||||
companies,
|
||||
completionContracts,
|
||||
createDb,
|
||||
heartbeatRuns,
|
||||
nativeRunFinalizations,
|
||||
nativeRunResults,
|
||||
statusDecisions,
|
||||
@@ -24,6 +25,7 @@ import {
|
||||
getEmbeddedPostgresTestSupport,
|
||||
startEmbeddedPostgresTestDatabase,
|
||||
} from "./helpers/embedded-postgres.js";
|
||||
import { drainHeartbeatRunsToQuiescence } from "./helpers/drain-heartbeat-runs.js";
|
||||
import {
|
||||
registerServerAdapter,
|
||||
unregisterServerAdapter,
|
||||
@@ -90,10 +92,14 @@ describeEmbeddedPostgres("direct adapter native-runner isolation", () => {
|
||||
}, 20_000);
|
||||
|
||||
afterEach(async () => {
|
||||
// Terminal run status is committed before trailing lifecycle events and
|
||||
// scratch cleanup settle. Drain those writes before taking the exclusive
|
||||
// TRUNCATE locks, or the cleanup transaction can deadlock with them.
|
||||
await heartbeat.drainActiveRunExecutions();
|
||||
await drainHeartbeatRunsToQuiescence(db, heartbeat);
|
||||
const runStatuses = await db
|
||||
.select({ status: heartbeatRuns.status })
|
||||
.from(heartbeatRuns);
|
||||
const pendingRuns = runStatuses.filter(
|
||||
(run) => run.status === "queued" || run.status === "running",
|
||||
);
|
||||
expect(pendingRuns).toEqual([]);
|
||||
vi.clearAllMocks();
|
||||
await db.execute(
|
||||
sql.raw(`
|
||||
@@ -119,10 +125,10 @@ describeEmbeddedPostgres("direct adapter native-runner isolation", () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await drainHeartbeatRunsToQuiescence(db, heartbeat);
|
||||
for (const [adapterType] of DIRECT_ADAPTERS) {
|
||||
unregisterServerAdapter(adapterType);
|
||||
}
|
||||
await heartbeat.drainActiveRunExecutions();
|
||||
await tempDb?.cleanup();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user