-
Notifications
You must be signed in to change notification settings - Fork 208
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
test updating instances in promiseSpace updates agoricNames #9989
Conversation
For the purposes of conversation, this test shows that
does indeed update agoricNames.
|
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.
This shows that the short version works in at least some cases.
It doesn't hurt to land this as-is, but should we look harder for problems first?
const auctionInstance1 = makeHandle('instance1'); | ||
const instanceLookup = await agoricNames.lookup('instance'); | ||
|
||
// @ts-expect-error storing fake instance | ||
space.instance.produce.auctioneer.resolve(auctionInstance1); | ||
// @ts-expect-error expecting instance | ||
t.is(await space.instance.consume.auctioneer, auctionInstance1); |
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.
I suggest moving the error to where auctionInstance1
is declared:
const auctionInstance1 = makeHandle('instance1'); | |
const instanceLookup = await agoricNames.lookup('instance'); | |
// @ts-expect-error storing fake instance | |
space.instance.produce.auctioneer.resolve(auctionInstance1); | |
// @ts-expect-error expecting instance | |
t.is(await space.instance.consume.auctioneer, auctionInstance1); | |
/** @type { Instance } */ | |
// @ts-expect-error mock | |
const auctionInstance1 = makeHandle('instance1'); | |
const instanceLookup = await agoricNames.lookup('instance'); | |
space.instance.produce.auctioneer.resolve(auctionInstance1); | |
t.is(await space.instance.consume.auctioneer, auctionInstance1); |
I'd like to look harder, but I don't know what to look for. My current (very tentative) hypothesis is that the promises are taking a while to resolve in the upgrade coreEval. |
We can look there, I think, by controlling which promises resolve when in a test. We might have to introduce a few more moving parts. hm. |
I now suspect that the issue is a subtle form of TOCTOU. When dealing with values in the promise space that are being updated during the same run, you can easily get a value from before the change, even if you think one proposal is supposed to happen after another. Particular with multiple core-evals, the process starts them in parallel, and satisfies Similarly, if you retrieve sub-tables from @dckc would you mind if I closed this? Is the test worth cleaning up and merging? |
I don't mind. Go ahead |
refs: #9970
Description
While preparing a coreEval for the vaults&Auctions release, I found it necessary to update both
instance.produce.auctioneer
andagoricNamesAdmin.lookupAdmin('instance')
.This test shows that updating the former causes the latter to update.
Testing Considerations