-
Notifications
You must be signed in to change notification settings - Fork 219
Fix issue when files for paused sandbox are not uploaded yet #1615
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
Merged
jakubno
merged 11 commits into
main
from
fix-issue-when-files-for-paused-sandbox-are-not-uploaded-yet-eng-3395
Dec 15, 2025
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7130e09
Handle resume with not uploaded files
jakubno 6c2f542
Add tests
jakubno 17314d4
Add test
jakubno f6a21ac
Add missing telemetry
jakubno 71dca16
Lint
jakubno 0dc1dc7
Don't use excluded node
jakubno 4c46104
Clean up
jakubno 2847463
Add queue for resuming sandboxes
jakubno ba603f1
Fix test
jakubno 17889a6
Simplify
jakubno 3ee22ce
Remove the logic from API
jakubno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
tests/integration/internal/tests/orchestrator/sandbox_object_not_found_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package orchestrator | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
| "google.golang.org/grpc/codes" | ||
| "google.golang.org/grpc/status" | ||
| "google.golang.org/protobuf/types/known/timestamppb" | ||
|
|
||
| "github.com/e2b-dev/infra/packages/shared/pkg/grpc/orchestrator" | ||
| "github.com/e2b-dev/infra/tests/integration/internal/setup" | ||
| ) | ||
|
|
||
| func TestSandboxObjectNotFound(t *testing.T) { | ||
| ctx, cancel := context.WithCancel(t.Context()) | ||
| defer cancel() | ||
|
|
||
| client := setup.GetOrchestratorClient(t, ctx) | ||
|
|
||
| _, err := client.Create(ctx, &orchestrator.SandboxCreateRequest{ | ||
| Sandbox: &orchestrator.SandboxConfig{ | ||
| TemplateId: "nonexistent-template-id", | ||
| BuildId: "98d62f9d-9e91-492a-b3e7-03d464778a2e", | ||
| KernelVersion: "not-needed-here", | ||
| FirecrackerVersion: "not-needed-here", | ||
| HugePages: true, | ||
| SandboxId: "sandbox-with-nonexistent-template-id", | ||
| EnvVars: nil, | ||
| Metadata: nil, | ||
| Alias: nil, | ||
| EnvdVersion: "", | ||
| Vcpu: 0, | ||
| RamMb: 0, | ||
| TeamId: "", | ||
| MaxSandboxLength: 0, | ||
| TotalDiskSizeMb: 0, | ||
| Snapshot: false, | ||
| BaseTemplateId: "", | ||
| AutoPause: false, | ||
| EnvdAccessToken: nil, | ||
| ExecutionId: "", | ||
| AllowInternetAccess: nil, | ||
| Network: nil, | ||
| }, | ||
| StartTime: timestamppb.Now(), | ||
| EndTime: timestamppb.Now(), | ||
| }) | ||
| require.Error(t, err) | ||
|
|
||
| st, ok := status.FromError(err) | ||
| require.True(t, ok, "err should be a status error") | ||
| assert.Equal(t, codes.FailedPrecondition, st.Code(), "status code should be FailedPrecondition") | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
simplified the logic a little