Skip to content

Commit

Permalink
Add logging for the other flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Mar 8, 2024
1 parent aff0d68 commit d82b679
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/main/java/appeng/server/testplots/TestPlots.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.google.common.collect.Sets;

import com.mojang.logging.LogUtils;
import org.jetbrains.annotations.Nullable;

import net.minecraft.Util;
Expand Down Expand Up @@ -77,6 +78,7 @@
import appeng.server.testworld.PlotBuilder;
import appeng.server.testworld.TestCraftingJob;
import appeng.util.CraftingRecipeUtil;
import org.slf4j.Logger;

public final class TestPlots {
private static final List<Class<?>> PLOT_CLASSES = new ArrayList<>();
Expand Down Expand Up @@ -608,6 +610,8 @@ public static void testInsertFluidIntoMEChest(PlotBuilder plot) {
}));
}

private static final Logger LOGGER = LogUtils.getLogger();

/**
* Regression test for https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/6582
*/
Expand All @@ -623,12 +627,21 @@ public static void testInsertItemsIntoMEChest(PlotBuilder plot) {
// Hopper to test insertion of stuff. It should try to insert stick first.
plot.hopper(origin.above(), Direction.DOWN, Items.STICK, Items.REDSTONE);

plot.test(helper -> helper.succeedWhen(() -> {
var meChest = (appeng.blockentity.storage.ChestBlockEntity) helper.getBlockEntity(origin);
helper.assertContains(meChest.getInventory(), AEItemKey.of(Items.REDSTONE));
// The stick should still be in the hopper
helper.assertContainerContains(origin.above(), Items.STICK);
}));
plot.test(helper -> helper
.startSequence()
.thenExecute(() -> {
LOGGER.debug("Hopper position: " + helper.absolutePos(origin.above()));
})
.thenWaitUntil(() -> {
var meChest = (appeng.blockentity.storage.ChestBlockEntity) helper.getBlockEntity(origin);
LOGGER.debug("ME Chest data: " + meChest.saveWithoutMetadata());
helper.assertContains(meChest.getInventory(), AEItemKey.of(Items.REDSTONE));
// The stick should still be in the hopper
var hopper = helper.getBlockEntity(origin.above());
LOGGER.debug("Hopper data: " + hopper.saveWithoutMetadata());
helper.assertContainerContains(origin.above(), Items.STICK);
})
.thenSucceed());
}

@TestPlot("maxchannels_adhoctest")
Expand Down

0 comments on commit d82b679

Please sign in to comment.