Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdml committed Jan 31, 2025
1 parent 36588be commit 77b11dc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/wfqueue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ describe("queued-wf-tests-recovery", () => {

beforeEach(async () => {
TestWFs.reset();
process.env["DBOS__VMID"] = "test-vmid-1";
await DBOS.launch();
systemDBClient = new Client({
user: config.poolConfig.user,
Expand All @@ -399,7 +398,6 @@ describe("queued-wf-tests-recovery", () => {
afterEach(async () => {
await DBOS.shutdown();
await systemDBClient.end();
delete process.env["DBOS__VMID"];
}, 10000);

test("queued-wf-recovery", async () => {
Expand Down Expand Up @@ -429,10 +427,10 @@ describe("queued-wf-tests-recovery", () => {
const workflows = await DBOS.getWorkflowQueue({ queueName: recoveryQueue.name });
expect(workflows.workflows.length).toBe(3);
expect(workflows.workflows[2].workflowID).toBe(wfid1);
expect(workflows.workflows[2].executorID).toBe("test-vmid-1");
expect(workflows.workflows[2].executorID).toBe("local");
expect((await wfh1.getStatus())?.status).toBe(StatusString.PENDING);
expect(workflows.workflows[1].workflowID).toBe(wfid2);
expect(workflows.workflows[1].executorID).toBe("test-vmid-1");
expect(workflows.workflows[1].executorID).toBe("local");
expect((await wfh2.getStatus())?.status).toBe(StatusString.PENDING);
expect(workflows.workflows[0].workflowID).toBe(wfid3);
expect(workflows.workflows[0].executorID).toBe(null);
Expand All @@ -453,9 +451,9 @@ describe("queued-wf-tests-recovery", () => {
expect(await wfh2.getResult()).toBe(null);
// Now the third workflow should have been dequeeud and complete
expect(await wfh3.getResult()).toBe(null);
// (And executed by test-vmid-1)
// (And executed by local)
const result = await systemDBClient.query("SELECT executor_id FROM dbos.workflow_status WHERE workflow_uuid = $1", [wfh3.workflowID]);
expect(result.rows).toEqual([{ executor_id: "test-vmid-1" }]);
expect(result.rows).toEqual([{ executor_id: "local" }]);

TestWFs.blockedWorkflowPromise = undefined;
}, 20000);
Expand Down

0 comments on commit 77b11dc

Please sign in to comment.