Commit 62937cf5 authored by yangguo's avatar yangguo Committed by Commit bot

[test] Speed up some slow tests.

- split up cctest/test-api/Threading*
- shortened mjsunit/math-floor-part*
- split up cctest/test-serialize/CustomSnapshotDataBlob
- skipped mjsunit/regress/regress-crbug-474297 unless gc-stress
- shortened cctest/test-serialize/CodeSerializerLargeCodeObject

R=jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2470143004
Cr-Commit-Position: refs/heads/master@{#40753}
parent 1dd241c4
......@@ -189,11 +189,17 @@ class ApiTestFuzzer: public v8::base::Thread {
// The ApiTestFuzzer is also a Thread, so it has a Run method.
virtual void Run();
enum PartOfTest { FIRST_PART,
SECOND_PART,
THIRD_PART,
FOURTH_PART,
LAST_PART = FOURTH_PART };
enum PartOfTest {
FIRST_PART,
SECOND_PART,
THIRD_PART,
FOURTH_PART,
FIFTH_PART,
SIXTH_PART,
SEVENTH_PART,
EIGHTH_PART,
LAST_PART = EIGHTH_PART
};
static void SetUp(PartOfTest part);
static void RunAllTests();
......
......@@ -68,7 +68,8 @@
'test-ast-types/*': [PASS, NO_VARIANTS],
# This tests API threading, no point in running several variants.
'test-api/Threading*': [PASS, NO_VARIANTS],
# They are also slow in debug mode.
'test-api/Threading*': [PASS, NO_VARIANTS, ['mode == debug', SLOW]],
# BUG(2999). The cpu profiler tests are notoriously flaky.
'test-cpu-profiler/CpuProfileDeepStack': [SKIP],
......@@ -94,10 +95,6 @@
############################################################################
# Slow tests.
'test-api/Threading1': [PASS, ['mode == debug', SLOW]],
'test-api/Threading2': [PASS, ['mode == debug', SLOW]],
'test-api/Threading3': [PASS, ['mode == debug', SLOW]],
'test-api/Threading4': [PASS, ['mode == debug', SLOW]],
'test-debug/CallFunctionInDebugger': [PASS, ['mode == debug', SLOW]],
'test-strings/StringOOM*': [PASS, ['mode == debug', SKIP]],
'test-serialize/CustomSnapshotDataBlobImmortalImmovableRoots': [PASS, ['mode == debug', SKIP]],
......@@ -134,8 +131,6 @@
# Pass but take too long with the simulator.
'test-api/ExternalArrays': [PASS, TIMEOUT],
'test-api/Threading1': [SKIP],
'test-api/Threading2': [SKIP],
}], # 'arch == arm64 and simulator_run == True'
['arch == arm64 and mode == debug and simulator_run == True', {
......@@ -167,10 +162,7 @@
'test-strings/CountBreakIterator': [SKIP],
# Slow tests.
'test-api/Threading1': [PASS, SLOW],
'test-api/Threading2': [PASS, SLOW],
'test-api/Threading3': [PASS, SLOW],
'test-api/Threading4': [PASS, SLOW],
'test-api/Threading*': [PASS, SLOW],
}], # 'msan == True'
##############################################################################
......@@ -229,10 +221,7 @@
############################################################################
# Slow tests.
'test-api/Threading1': [PASS, SLOW],
'test-api/Threading2': [PASS, SLOW],
'test-api/Threading3': [PASS, SLOW],
'test-api/Threading4': [PASS, SLOW],
'test-api/Threading*': [PASS, SLOW],
}], # 'arch == arm'
##############################################################################
......@@ -256,7 +245,8 @@
# TODO(mips-team): Currently fails on mips board.
'test-parsing/TooManyArguments': [SKIP],
'test-api/Threading3': [SKIP],
'test-api/Threading5': [SKIP],
'test-api/Threading6': [SKIP],
}], # 'arch == mips'
##############################################################################
......@@ -329,8 +319,7 @@
['arch == ppc and simulator_run == True or arch == ppc64 and simulator_run == True', {
# Pass but take too long with the simulator.
'test-api/Threading1': [PASS, SLOW],
'test-api/Threading2': [PASS, SLOW],
'test-api/Threading*': [PASS, SLOW],
'test-api/ExternalArrays': [PASS, SLOW],
}], # 'arch == ppc64 and simulator_run == True'
......
......@@ -13820,34 +13820,23 @@ void ApiTestFuzzer::CallTest() {
test_number_);
}
// Lets not be needlessly self-referential.
TEST(Threading1) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::FIRST_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
TEST(Threading2) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::SECOND_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
TEST(Threading3) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::THIRD_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
TEST(Threading4) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::FOURTH_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
#define THREADING_TEST(INDEX, NAME) \
TEST(Threading##INDEX) { \
ApiTestFuzzer::SetUp(ApiTestFuzzer::NAME); \
ApiTestFuzzer::RunAllTests(); \
ApiTestFuzzer::TearDown(); \
}
THREADING_TEST(1, FIRST_PART)
THREADING_TEST(2, SECOND_PART)
THREADING_TEST(3, THIRD_PART)
THREADING_TEST(4, FOURTH_PART)
THREADING_TEST(5, FIFTH_PART)
THREADING_TEST(6, SIXTH_PART)
THREADING_TEST(7, SEVENTH_PART)
THREADING_TEST(8, EIGHTH_PART)
#undef THREADING_TEST
static void ThrowInJS(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
......
......@@ -609,16 +609,11 @@ UNINITIALIZED_TEST(PartialSerializerCustomContext) {
v8_isolate->Dispose();
}
TEST(CustomSnapshotDataBlob) {
TEST(CustomSnapshotDataBlob1) {
DisableTurbofan();
const char* source1 = "function f() { return 42; }";
const char* source2 =
"function f() { return g() * 2; }"
"function g() { return 43; }"
"/./.test('a')";
v8::StartupData data1 = v8::V8::CreateSnapshotDataBlob(source1);
v8::StartupData data2 = v8::V8::CreateSnapshotDataBlob(source2);
v8::Isolate::CreateParams params1;
params1.snapshot_blob = &data1;
......@@ -637,6 +632,16 @@ TEST(CustomSnapshotDataBlob) {
CHECK(CompileRun("this.g")->IsUndefined());
}
isolate1->Dispose();
}
TEST(CustomSnapshotDataBlob2) {
DisableTurbofan();
const char* source2 =
"function f() { return g() * 2; }"
"function g() { return 43; }"
"/./.test('a')";
v8::StartupData data2 = v8::V8::CreateSnapshotDataBlob(source2);
v8::Isolate::CreateParams params2;
params2.snapshot_blob = &data2;
......@@ -657,7 +662,6 @@ TEST(CustomSnapshotDataBlob) {
isolate2->Dispose();
}
static void SerializationFunctionTemplate(
const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(args[0]);
......@@ -1070,9 +1074,9 @@ TEST(CodeSerializerLargeCodeObject) {
FLAG_always_opt = false;
Vector<const uint8_t> source =
ConstructSource(STATIC_CHAR_VECTOR("var j=1; if (!j) {"),
ConstructSource(STATIC_CHAR_VECTOR("var j=1; if (j == 0) {"),
STATIC_CHAR_VECTOR("for (let i of Object.prototype);"),
STATIC_CHAR_VECTOR("} j=7; j"), 2000);
STATIC_CHAR_VECTOR("} j=7; j"), 1000);
Handle<String> source_str =
isolate->factory()->NewStringFromOneByte(source).ToHandleChecked();
......
......@@ -109,6 +109,7 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 100; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
......@@ -111,6 +111,7 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 100; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
......@@ -93,11 +93,11 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 100; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
// Regression test for a bug where a negative zero coming from Math.floor
// was not properly handled by other operations.
function floorsum(i, n) {
......
......@@ -172,7 +172,7 @@
'numops-fuzz-part*': [PASS, ['mode == debug', SLOW]],
'readonly': [PASS, SLOW],
'regress/regress-1200351': [PASS, SLOW],
'regress/regress-crbug-474297': [PASS, ['mode == debug', SLOW]],
'regress/regress-crbug-474297': [PASS, ['gc_stress == False', SKIP]],
'es6/tail-call-megatest*': [PASS, SLOW, FAST_VARIANTS, ['tsan', SKIP]],
# case-insensitive unicode regexp relies on case mapping provided by ICU.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment