From e2358ad2f15678f7a3378237bed1c4893509d464 Mon Sep 17 00:00:00 2001 From: Neil Vohra Date: Thu, 21 Jul 2022 08:00:30 +0000 Subject: [PATCH] Add shutdown call after each test to initialize a new sandbox env for every test. Before this change, only the first APCT test that ran had a non-zero SANDBOX_INIT_TIME_AVG value. With the change, all tests populate this value since they create a new sandbox env. Test: Running APCT tests. Results: https://paste.googleplex.com/4864291380396032 Change-Id: Ic6285a0695e7559181bf09ab4aca5e905f14a984 --- .../src/android/rubidium/js/JSScriptEnginePerfTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java b/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java index 0ddec236b6dad..81685cbbd5942 100644 --- a/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java +++ b/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java @@ -48,6 +48,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import org.json.JSONArray; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -86,6 +87,11 @@ public class JSScriptEnginePerfTests { "function test() { return \"hello world\";" + " }", ImmutableList.of(), "test"); } + @After + public void after() { + sJSScriptEngine.shutdown(); + } + @Test public void evaluate_helloWorld() throws Exception { BenchmarkState state = mPerfStatusReporter.getBenchmarkState();