summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/media
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-12-09 11:55:06 -0800
committerShentubot <shentubot@google.com>2020-12-09 15:56:08 -0800
commit992769c7748d886e7ee1580f0c6cfdfa7ce0eb75 (patch)
treed8cc08dbd93588c7badde91ca1d9dea4ea9edfd7 /test/benchmarks/media
parent45619ded38b9c9f24b2b7ade812fd903e09ac1b9 (diff)
Add tensorflow, ffmpeg, and redis jobs.
PiperOrigin-RevId: 346603153
Diffstat (limited to 'test/benchmarks/media')
-rw-r--r--test/benchmarks/media/BUILD5
-rw-r--r--test/benchmarks/media/ffmpeg_test.go12
-rw-r--r--test/benchmarks/media/media.go15
3 files changed, 12 insertions, 20 deletions
diff --git a/test/benchmarks/media/BUILD b/test/benchmarks/media/BUILD
index 46e8dc8b5..380783f0b 100644
--- a/test/benchmarks/media/BUILD
+++ b/test/benchmarks/media/BUILD
@@ -7,12 +7,11 @@ go_library(
name = "media",
testonly = 1,
srcs = ["media.go"],
- deps = ["//test/benchmarks/harness"],
)
benchmark_test(
- name = "media_test",
- size = "large",
+ name = "ffmpeg_test",
+ size = "enormous",
srcs = ["ffmpeg_test.go"],
library = ":media",
visibility = ["//:sandbox"],
diff --git a/test/benchmarks/media/ffmpeg_test.go b/test/benchmarks/media/ffmpeg_test.go
index 7822dfad7..a462ec2a6 100644
--- a/test/benchmarks/media/ffmpeg_test.go
+++ b/test/benchmarks/media/ffmpeg_test.go
@@ -15,6 +15,7 @@ package media
import (
"context"
+ "os"
"strings"
"testing"
@@ -22,6 +23,8 @@ import (
"gvisor.dev/gvisor/test/benchmarks/harness"
)
+var h harness.Harness
+
// BenchmarkFfmpeg runs ffmpeg in a container and records runtime.
// BenchmarkFfmpeg should run as root to drop caches.
func BenchmarkFfmpeg(b *testing.B) {
@@ -32,13 +35,13 @@ func BenchmarkFfmpeg(b *testing.B) {
defer machine.CleanUp()
ctx := context.Background()
- container := machine.GetContainer(ctx, b)
- defer container.CleanUp(ctx)
cmd := strings.Split("ffmpeg -i video.mp4 -c:v libx264 -preset veryslow output.mp4", " ")
b.ResetTimer()
for i := 0; i < b.N; i++ {
b.StopTimer()
+ container := machine.GetContainer(ctx, b)
+ defer container.CleanUp(ctx)
if err := harness.DropCaches(machine); err != nil {
b.Skipf("failed to drop caches: %v. You probably need root.", err)
}
@@ -51,3 +54,8 @@ func BenchmarkFfmpeg(b *testing.B) {
}
}
}
+
+func TestMain(m *testing.M) {
+ h.Init()
+ os.Exit(m.Run())
+}
diff --git a/test/benchmarks/media/media.go b/test/benchmarks/media/media.go
index c7b35b758..ed7b24651 100644
--- a/test/benchmarks/media/media.go
+++ b/test/benchmarks/media/media.go
@@ -14,18 +14,3 @@
// Package media holds benchmarks around media processing applications.
package media
-
-import (
- "os"
- "testing"
-
- "gvisor.dev/gvisor/test/benchmarks/harness"
-)
-
-var h harness.Harness
-
-// TestMain is the main method for package media.
-func TestMain(m *testing.M) {
- h.Init()
- os.Exit(m.Run())
-}