Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index 8852b8820ffa19573fdcd26bb4a661bdab1acc42..31d817c924c2a5d5e004e5273cb850186f2987b8 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -4360,7 +4360,7 @@ TEST(PromotionQueue) { |
// In this test we will try to overwrite the promotion queue which is at the |
// end of to-space. To actually make that possible, we need at least two |
- // semi-space pages and take advantage of fragementation. |
+ // semi-space pages and take advantage of fragmentation. |
// (1) Grow semi-space to two pages. |
// (2) Create a few small long living objects and call the scavenger to |
// move them to the other semi-space. |
@@ -4380,6 +4380,12 @@ TEST(PromotionQueue) { |
// Grow the semi-space to two pages to make semi-space copy overwrite the |
// promotion queue, which will be at the end of the second page. |
intptr_t old_capacity = new_space->Capacity(); |
+ |
+ // If we are in a low memory config, we can't grow to two pages and we can't |
+ // run this test. This also means the issue we are testing cannot arise, as |
+ // there is no fragmentation. |
+ if (new_space->IsAtMaximumCapacity()) return; |
+ |
new_space->Grow(); |
CHECK(new_space->IsAtMaximumCapacity()); |
CHECK(2 * old_capacity == new_space->Capacity()); |