-
Notifications
You must be signed in to change notification settings - Fork 226
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(cosmic-swingset): Add test coverage for Prometheus output #10954
Conversation
af8cdb2
to
799daa7
Compare
Deploying agoric-sdk with
|
Latest commit: |
a820af8
|
Status: | ✅ Deploy successful! |
Preview URL: | https://87e763ce.agoric-sdk.pages.dev |
Branch Preview URL: | https://gibson-10911-prometheus-snap.agoric-sdk.pages.dev |
799daa7
to
452567e
Compare
Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label. |
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 looks like the beginning of some awesome test framework for cosmic-swingset. Pretty amazing!
I am however concerned the hangover / savedChainSends logic got hurt in the refactor. (it was really hard to track where things moved, I kinda wish that refactor commit could have been split in multiple commits to facilitate diffing)
import '@endo/eventual-send/shim.js'; | ||
|
||
try { | ||
lockdown({ __hardenTaming__: 'unsafe' }); |
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.
Sad, we can't even test if the intrinsics are frozen with unsafe harden.
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'm pretty sure this matches behavior of the import '@endo/init/unsafe-fast.js'
s it is replacing:
https://github.com/endojs/endo/blob/master/packages/init/unsafe-fast.js
import { lockdown } from '@endo/lockdown';
"main": "pre.js"
import 'ses';
globalThis.lockdown = lockdown;
import './pre-remoting.js';
export * from '@endo/init/pre.js';
export * from '@endo/eventual-send/shim.js';
const options = { __hardenTaming__: 'unsafe', }; lockdown(options);
We might be able to change it; I just needed to avoid double-lockdown errors.
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.
The part that you're missing is that '@endo/init/pre.js'
is mapped to init/src/pre-node.js
on node through the package.json
exports
, which imports both './node-async_hooks-patch.js'
and '../pre.js'
.
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.
Should the file's name capture this is doing an unsafe lockdown ?
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.
Also the original @endo/init
also tames async_hooks which this doesn't do. See endojs/endo#2711
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'm fine with this as-is, but will accept suggestions.
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 would prefer renaming this file to maybe-unsafe-lockdown.js
to avoid hiding the unsafe
harden taming.
e32baf0
to
96713e6
Compare
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.
Thanks so much for rebasing and splitting that refactor commit. It's so much easier to follow now.
Besides the minor feedback on the maybe lockdown file, this looks great! Feel free to merge once ready.
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 would prefer renaming this file to maybe-unsafe-lockdown.js
to avoid hiding the unsafe
harden taming.
const { name: dbDir, removeCallback: cleanupDB } = tmp.dirSync({ | ||
prefix: debugName || 'testdb', | ||
unsafeCleanup: true, | ||
}); | ||
const launchChain = makeLaunchChain(fakeAgcc, dbDir, { |
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'm pretty sure that stateDBDir
is unused if slogSender
and swingStore
are provided.
…l to launch Move the rest into AG_COSMOS_INIT processing
… future diff output
… in defaultInitMessage
…f makeLaunchChain
…akeCosmicSwingsetTestKit
…down.js ...for better indicating its behavior
2a77aac
to
a820af8
Compare
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
Extends #10941
Fixes #10911
Description
Extracts a testable
launchChain
unit in packages/cosmic-swingset/src/chain-main.js, and uses that for an ava snapshot test of localhost:${OTEL_EXPORTER_PROMETHEUS_PORT}/metrics. Includes incidental fixes and utility additions along the way (and therefore best reviewed by commit).Security Considerations
None known.
Scaling Considerations
n/a
Documentation Considerations
n/a
Testing Considerations
Just the usual
--update-snapshots
when things change.Upgrade Considerations
n/a