Skip to content

Commit 6209e35

Browse files
committed
Move after setting env
1 parent 8a6dfc9 commit 6209e35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/orchestrator/benchmark_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ func BenchmarkBaseImageLaunch(b *testing.B) {
4848
b.Skip("skipping benchmark because not running as root")
4949
}
5050

51-
networkConfig, err := network.ParseConfig()
52-
if err != nil {
53-
b.Fatalf("error parsing config: %v", err)
54-
}
55-
5651
// test configuration
5752
const (
5853
testType = onlyStart
@@ -69,7 +64,7 @@ func BenchmarkBaseImageLaunch(b *testing.B) {
6964
persistenceDir := filepath.Join(os.TempDir(), "e2b-orchestrator-benchmark")
7065
kernelsDir := filepath.Join(persistenceDir, "kernels")
7166
sandboxDir := filepath.Join(persistenceDir, "sandbox")
72-
err = os.MkdirAll(kernelsDir, 0o755)
67+
err := os.MkdirAll(kernelsDir, 0o755)
7368
require.NoError(b, err)
7469

7570
// ephemeral data
@@ -114,6 +109,11 @@ func BenchmarkBaseImageLaunch(b *testing.B) {
114109
b.Setenv("SNAPSHOT_CACHE_DIR", abs(filepath.Join(tempDir, "snapshot-cache")))
115110
b.Setenv("LOCAL_TEMPLATE_STORAGE_BASE_PATH", abs(filepath.Join(persistenceDir, "templates")))
116111

112+
networkConfig, err := network.ParseConfig()
113+
if err != nil {
114+
b.Fatalf("error parsing config: %v", err)
115+
}
116+
117117
// prep directories
118118
for _, subdir := range []string{"build", "build-templates" /*"fc-vm",*/, "sandbox", "snapshot-cache", "template"} {
119119
fullDirName := filepath.Join(tempDir, subdir)

0 commit comments

Comments
 (0)