Commit 9e3f20b2 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[test] Move cctest/test-log to unittests/logging/log-unittest

This is a reland of https://chromium-review.googlesource.com/c/v8/v8/+/3607389.
The previous revert is https://chromium-review.googlesource.com/c/v8/v8/+/3610448.
Reason for revert: https://crbug.com/v8/12838.

The original CL has merge conflicts and cannot be relanded,
so this CL is newly opened.

This CL moves cctest/test-log to unittests/logging/log-unittest
, fixes the flaky tests in https://bugs.chromium.org/p/v8/issues/detail?id=12838 and updates the unittests status for log-unittest.


Flaky Tests:
- https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/7287/overview
  - flaky LogTest.Issue539892 is caused by in stress-incremental-marking
    mode, Heap::MarkCompact will trigger CodeMovingGCEvent in https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/heap.cc;l=2586;drc=52f06e6b43ff95eccf79e0a5df8d4d83c029130a for
    FakeCodeEventLogger which was already destructed
    when Heap::PerformGarbageCollection task was handled in
    DefaultPlatform::PumpMessageLoop. This should be fixed by removing
    FakeCodeEventLogger in LogTest.Issue539892.

  - flaky LogTest.LogAccessorCallbacks is caused by the data race in
    Sampler::DoSample. This should be fixed in https://chromium-
    review.googlesource.com/c/v8/v8/+/3616429.

-https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN/41327/overview
  - flaky LogTest.ExternalLogEventListenerWithInterpretedFramesNativeStack
    is caused by the data race of i::FLAG_* which were written again after
    setting up the isolate. This should be fixed by only writting
    i::FLAG_* before setting up the Isolate.

- https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64/47277/overview
  - flaky LogTest.BuiltinsNotLoggedAsLazyCompile is caused by the data
    race in Sampler::DoSample. This should be fixed in https://chromium-
    review.googlesource.com/c/v8/v8/+/3616429.

Bug: v8:12781
Change-Id: I3f736d4ffb3b8f147006bebe92285684b0c3952a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3616424Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80423}
parent d48558e6
......@@ -232,7 +232,6 @@ v8_source_set("cctest_sources") {
"test-liveedit.cc",
"test-local-handles.cc",
"test-lockers.cc",
"test-log.cc",
"test-managed.cc",
"test-mementos.cc",
"test-orderedhashtable.cc",
......
......@@ -345,9 +345,6 @@
##############################################################################
['arch == arm', {
# BUG(355): Test crashes on ARM.
'test-log/ProfLazyMode': [SKIP],
# BUG(1075): Unresolved crashes.
'test-serialize/StartupSerializerOnce': [SKIP],
'test-serialize/StartupSerializerTwice': [SKIP],
......@@ -560,7 +557,6 @@
'test-parsing/*': [SKIP],
'test-page-promotion/*': [SKIP],
'test-decls/*': [SKIP],
'test-log/*': [SKIP],
'test-gap-resolver/*': [SKIP],
'test-dtoa/*': [SKIP],
}], # variant == no_wasm_traps
......@@ -662,9 +658,6 @@
# TODO(mythria): Code logging tests that currently fail with lazy feedback
# allocation. Fix logging to work without feedback vectors and enable these
# tests in lite_mode.
'test-log/ExternalLogEventListenerWithInterpretedFramesNativeStack': [SKIP],
'test-log/LogInterpretedFramesNativeStack': [SKIP],
'test-log/LogInterpretedFramesNativeStackWithSerialization': [SKIP],
'test-serialize/CodeSerializerOnePlusOneWithInterpretedFramesNativeStack': [SKIP]
}], # lite_mode
......@@ -692,9 +685,6 @@
'test-verify-type/*': [SKIP],
# --interpreted-frames-native-stack tests
'test-log/ExternalLogEventListenerWithInterpretedFramesNativeStack': [SKIP],
'test-log/LogInterpretedFramesNativeStack': [SKIP],
'test-log/LogInterpretedFramesNativeStackWithSerialization': [SKIP],
'test-serialize/CodeSerializerOnePlusOneWithInterpretedFramesNativeStack': [SKIP],
'test-interpreter/InterpreterWithNativeStack': [SKIP],
......@@ -820,8 +810,6 @@
'test-heap/Regress538257': [SKIP],
'test-heap/ReinitializeStringHashSeed': [SKIP],
'test-lockers/*': [SKIP],
'test-log/ExternalLogEventListenerInnerFunctions': [SKIP],
'test-log/LogInterpretedFramesNativeStackWithSerialization': [SKIP],
'test-managed/*': [SKIP],
'test-mark-compact/RegressJoinThreadsOnIsolateDeinit': [SKIP],
'test-memory-measurement/RandomizedTimeout': [SKIP],
......
......@@ -375,6 +375,7 @@ v8_source_set("unittests_sources") {
"libplatform/task-queue-unittest.cc",
"libplatform/worker-thread-unittest.cc",
"logging/counters-unittest.cc",
"logging/log-unittest.cc",
"numbers/bigint-unittest.cc",
"numbers/conversions-unittest.cc",
"objects/array-list-unittest.cc",
......
......@@ -137,6 +137,16 @@ class WithIsolateScopeMixin : public TMixin {
.ToLocalChecked());
}
Local<Script> CompileWithOrigin(Local<String> source,
Local<String> origin_url,
bool is_shared_cross_origin) {
Isolate* isolate = Isolate::GetCurrent();
ScriptOrigin origin(isolate, origin_url, 0, 0, is_shared_cross_origin);
ScriptCompiler::Source script_source(source, origin);
return ScriptCompiler::Compile(isolate->GetCurrentContext(), &script_source)
.ToLocalChecked();
}
void CollectGarbage(i::AllocationSpace space) {
i_isolate()->heap()->CollectGarbage(space,
i::GarbageCollectionReason::kTesting);
......
......@@ -117,6 +117,23 @@
'LoggingTest.SourceLocation':[SKIP] # issue-174
}],
##############################################################################
['lite_mode', {
# TODO(mythria): Code logging tests that currently fail with lazy feedback
# allocation. Fix logging to work without feedback vectors and enable these
# tests in lite_mode.
'LogExternalInterpretedFramesNativeStackTest.ExternalLogEventListenerWithInterpretedFramesNativeStack': [SKIP],
'LogInterpretedFramesNativeStackTest.LogInterpretedFramesNativeStack': [SKIP],
'LogInterpretedFramesNativeStackWithSerializationTest.LogInterpretedFramesNativeStackWithSerialization': [SKIP],
}], # lite_mode
['variant == jitless', {
# --interpreted-frames-native-stack tests
'LogExternalInterpretedFramesNativeStackTest.ExternalLogEventListenerWithInterpretedFramesNativeStack': [SKIP],
'LogInterpretedFramesNativeStackTest.LogInterpretedFramesNativeStack': [SKIP],
'LogInterpretedFramesNativeStackWithSerializationTest.LogInterpretedFramesNativeStackWithSerialization': [SKIP],
}], # jitless
################################################################################
['third_party_heap', {
# Tests on OptimizingCompileDispatcher
......@@ -140,6 +157,8 @@
'SpacesTest.WriteBarrierInYoungGenerationFromSpace': [SKIP],
# Requires a second isolate
'ValueSerializerTest.DecodeArrayBufferOOM': [SKIP],
'LogExternalLogEventListenerInnerFunctionTest.ExternalLogEventListenerInnerFunctions': [SKIP],
'LogInterpretedFramesNativeStackWithSerializationTest.LogInterpretedFramesNativeStackWithSerialization': [SKIP],
# Performs GC
'APIExceptionTest.ExceptionMessageDoesNotKeepContextAlive': [SKIP],
'LocalHeapTest.GCEpilogue': [SKIP],
......@@ -188,7 +207,17 @@
##############################################################################
['variant == no_wasm_traps', {
'APIExceptionTest.*': [SKIP],
'LogTest.*': [SKIP],
'TestWithIsolate.Issue23768': [SKIP],
'LogAllTest.LogAll': [SKIP],
'LogInterpretedFramesNativeStackTest.LogInterpretedFramesNativeStack': [SKIP],
'LogInterpretedFramesNativeStackWithSerializationTest.LogInterpretedFramesNativeStackWithSerialization': [SKIP],
'LogExternalLogEventListenerTest.ExternalLogEventListener': [SKIP],
'LogExternalLogEventListenerInnerFunctionTest.ExternalLogEventListenerInnerFunctions': [SKIP],
'LogExternalInterpretedFramesNativeStackTest.ExternalLogEventListenerWithInterpretedFramesNativeStack': [SKIP],
'LogMapsTest.*': [SKIP],
'LogMapsCodeTest.LogMapsDetailsCode': [SKIP],
'LogFunctionEventsTest.LogFunctionEvents': [SKIP],
}], # variant == no_wasm_traps
##############################################################################
......
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