Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index bbf2f98875b417ecf2dcf0f2a605f0c6de26caef..dce2d52ade91974e85600fb17a9291cd36236ef6 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -18172,9 +18172,15 @@ TEST(RecursionWithSourceURLInMessageScriptResourceNameOrSourceURL) { |
static void CreateGarbageInOldSpace() { |
i::Factory* factory = CcTest::i_isolate()->factory(); |
v8::HandleScope scope(CcTest::isolate()); |
- i::AlwaysAllocateScope always_allocate(CcTest::i_isolate()); |
- for (int i = 0; i < 1000; i++) { |
- factory->NewFixedArray(1000, i::TENURED); |
+ { |
+ i::AlwaysAllocateScope always_allocate(CcTest::i_isolate()); |
+ for (int i = 0; i < 1000; i++) { |
+ factory->NewFixedArray(1000, i::TENURED); |
+ } |
+ } |
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask); |
+ if (CcTest::heap()->mark_compact_collector()->sweeping_in_progress()) { |
+ CcTest::heap()->mark_compact_collector()->EnsureSweepingCompleted(); |
} |
} |