-
Notifications
You must be signed in to change notification settings - Fork 487
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 getTimeout methods to the SDKs #517
base: main
Are you sure you want to change the base?
Conversation
mishushakov
commented
Dec 20, 2024
- Adds the ability to retrieve the current timeout of the sandbox via SDK (pre-requisite for events)
|
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.
Same comments about js-sdk apply to python-sdk.
|
||
await sandbox.isRunning() | ||
sandboxTest.skipIf(isDebug)('get sandbox timeout', async ({ sandbox }) => { |
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.
some assertions around the time left after a waiting for a period of time with reasonable margins could be insightful here?
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.
my test pass
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 meant assert that some of the expected time arithmetic is ball park what we would expect, ie setTimeout(1000ms) <=> endAt == now() + ~1000ms
@mishushakov Please add sections/pages to docs so people know this method exists and how it can be used |
I was checking RFC about adding sandbox state getter (https://github.com/e2b-dev/RFCs/pull/6/files) and I think these are related—maybe the state should be part of the info? It is possible that we can add the state later, but I would like to have a high-level agreement on where these things should be. |
State can be a part of the info, I agree, but maybe we don't need getInfo as it might be too opaque (what info?) and instead getState() and getEndDate() / getTimeout() |
Yes, I think having the state, endDate, etc., separated is better here. |