-
Notifications
You must be signed in to change notification settings - Fork 206
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
base: master
Are you sure you want to change the base?
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. |
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