Skip to content

Commit

Permalink
fix(daemon): Correctly use worker formula number in incarnateEval
Browse files Browse the repository at this point in the history
`incarnateEval()` was accidentally passing worker formula identifiers
instead of formula numbers when it received a specified worker formula
identifier. This caused `eval` formulas to always fail on Windows due to
a `:` in the path.

Surprisingly, fixing this caused the "indirect termination" test to
fail. This is likely just surfacing a deeper problem, see #2074.
  • Loading branch information
rekmarks committed Feb 22, 2024
1 parent b2522bf commit e285f4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/daemon/src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,9 @@ const makeDaemonCore = async (
evalFormulaNumber,
} = await formulaGraphMutex.enqueue(async () => {
const ownFormulaNumber = await randomHex512();
const workerFormulaNumber = await (specifiedWorkerFormulaIdentifier ??
randomHex512());
const workerFormulaNumber = await (specifiedWorkerFormulaIdentifier
? parseFormulaIdentifier(specifiedWorkerFormulaIdentifier).number
: randomHex512());

const identifiers = harden({
workerFormulaIdentifier: (
Expand Down
3 changes: 2 additions & 1 deletion packages/daemon/test/test-endo.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ test('direct termination', async t => {
t.pass();
});

test('indirect termination', async t => {
// See: https://github.com/endojs/endo/issues/2074
test.failing('indirect termination', async t => {
const { promise: cancelled, reject: cancel } = makePromiseKit();
t.teardown(() => cancel(Error('teardown')));

Expand Down

0 comments on commit e285f4c

Please sign in to comment.