Skip to content
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

Add strict liveslots test env with upgrade tools #10126

Merged
merged 11 commits into from
Sep 25, 2024

Conversation

mhofman
Copy link
Member

@mhofman mhofman commented Sep 21, 2024

closes: #9126

Best reviewed commit-by-commit

Description

This PR add a new prepare-strict-test-env.js which enforces durable requirements on the baggage and provide helpers to simulate upgrades based on the helper from the async-flow and zone package tests.

In particular it adds a new startLife helper which enforces kind redefinition rules for a build step, and rejects previously watched promises (assuming they were all decided by the previous incarnation).

Security Considerations

None, test infra only

Scaling Considerations

None

Documentation Considerations

Some types added and clarified. Internal tooling

Testing Considerations

Adds tests of the new strict env and startLife helper.
Add liveslots based test in vow using the new startLife helper.
Updated the test environments in the zone and async-flow package to use the new liveslots env, but does not update the async-flow tests to use the stricter startLife (will be done in #9933 or #9383)

Upgrade Considerations

Better upgrade testing without needing a full swingset kernel

Copy link

cloudflare-workers-and-pages bot commented Sep 21, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9300ae8
Status: ✅  Deploy successful!
Preview URL: https://e6c7a440.agoric-sdk.pages.dev
Branch Preview URL: https://mhofman-9126-higher-fidelity.agoric-sdk.pages.dev

View logs

@mhofman mhofman requested a review from kriskowal September 23, 2024 23:55
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great stuff! I noticed just some minor details I'd like to see improved.

Approving conditionally assuming those are addressed.

packages/swingset-liveslots/test/test-env-upgrade.test.js Outdated Show resolved Hide resolved
packages/swingset-liveslots/test/test-env-upgrade.test.js Outdated Show resolved Hide resolved
export const reincarnate = (options = {}) => {
const { fakeStore = new Map(), fakeVomKit: fvk } = options;
/**
* @typedef {import("@agoric/internal").Simplify<Omit<NonNullable<Parameters<typeof makeFakeVirtualStuff>[0]>, 'WeakMap' | 'WeakSet'> & {fakeVomKit: FakeVomKit; fakeStore: Map<string, string>}>} ReincarnateOptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some newlines in this typedef? I can't easily see which parts are nested under which other parts.

packages/vow/test/watch-upgrade.test.js Outdated Show resolved Hide resolved
packages/vow/test/watch-upgrade.test.js Outdated Show resolved Hide resolved
baggage => {
const zone = makeDurableZone(baggage, 'durableRoot');
prepareVowTools(zone);
zone.exo('DurableVowTestWatcher', undefined, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to do something with this watcher? It seems just to be dropped on the floor.

Suggested change
zone.exo('DurableVowTestWatcher', undefined, {
const watcher = zone.exo('DurableVowTestWatcher', undefined, {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior is redefined. This singleton exo is already setup as watcher in the previous incarnation, so we don't care about its identity here, just that a behavior is reconnected when invoked when resolving the vow.
Added a comment.

@mhofman mhofman added the automerge:rebase Automatically rebase updates, then merge label Sep 25, 2024
@mhofman mhofman force-pushed the mhofman/9126-higher-fidelity-fake-liveslots branch from dcd5441 to 9300ae8 Compare September 25, 2024 03:23
@mergify mergify bot merged commit 0cd32a5 into master Sep 25, 2024
80 checks passed
@mergify mergify bot deleted the mhofman/9126-higher-fidelity-fake-liveslots branch September 25, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

old vow watch not woken up by fulfillment in new incarnation.
2 participants