From a0bc0602e8f65a2dddd1d13c9ed6645254b7a2da Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 22 Nov 2021 01:47:56 +0100 Subject: [PATCH] Enable tests Adapt test results FallbacksFixturePropagate.computeFirstSuccessfulStagePerSolutionOnly due to 2e63c154aab41a9cde8684ac0880504cfc2a99d8: The order of computations has changed, because we lock the processed state as soon as it is forwarded to the first fallback child. In this case, after processing GEN1 und FWD1 once, we have the two states with costs 2, 4 in the queue. The first one, i.e. with cost 2 is forwarded to the child FWD2, which fails. In the next cycle, although we have new states in the queue (1, 2, 3, 4), we stick with state "2" and forward it two FWD3, which adds costs 210, resulting in 212. With previous code, the Fallback container switched to state "1", forwarded to FWD2. --- core/test/test_fallback.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/test/test_fallback.cpp b/core/test/test_fallback.cpp index 116fc001..d27b9fcf 100644 --- a/core/test/test_fallback.cpp +++ b/core/test/test_fallback.cpp @@ -67,7 +67,7 @@ TEST_F(FallbacksFixturePropagate, computeFirstSuccessfulStageOnly) { EXPECT_EQ(t.numSolutions(), 1u); } -TEST_F(FallbacksFixturePropagate, DISABLED_ComputeFirstSuccessfulStagePerSolutionOnly) { +TEST_F(FallbacksFixturePropagate, computeFirstSuccessfulStagePerSolutionOnly) { t.add(std::make_unique(PredefinedCosts({ 2.0, 1.0 }))); // duplicate generator solutions with resulting costs: 4, 2 | 3, 1 t.add(std::make_unique(PredefinedCosts({ 2.0, 0.0, 2.0, 0.0 }), 2)); @@ -78,10 +78,11 @@ TEST_F(FallbacksFixturePropagate, DISABLED_ComputeFirstSuccessfulStagePerSolutio t.add(std::move(fallbacks)); EXPECT_TRUE(t.plan()); - EXPECT_COSTS(t.solutions(), testing::ElementsAre(113, 124, 211, 222)); + EXPECT_COSTS(t.solutions(), testing::ElementsAre(113, 124, 212, 221)); } -TEST_F(FallbacksFixturePropagate, DISABLED_UpdateSolutionOrder) { +// requires individual job control in Fallbacks's children +TEST_F(FallbacksFixturePropagate, DISABLED_updateSolutionOrder) { t.add(std::make_unique(PredefinedCosts({ 10.0, 0.0 }))); t.add(std::make_unique(PredefinedCosts({ 1.0, 2.0 }))); // available solutions (sorted) in individual runs of fallbacks: 1 | 11, 2 | 2, 11 @@ -100,7 +101,8 @@ TEST_F(FallbacksFixturePropagate, DISABLED_UpdateSolutionOrder) { EXPECT_COSTS(t.solutions(), testing::ElementsAre(2)); // expecting less costly solution as result } -TEST_F(FallbacksFixturePropagate, DISABLED_MultipleActivePendingStates) { +// requires individual job control in Fallbacks's children +TEST_F(FallbacksFixturePropagate, DISABLED_multipleActivePendingStates) { t.add(std::make_unique(PredefinedCosts({ 2.0, 1.0, 3.0 }))); // use a fallback container to delay computation: the 1st child never succeeds, but only the 2nd auto inner = std::make_unique("Inner"); @@ -159,7 +161,7 @@ TEST_F(FallbacksFixturePropagate, activeChildReset) { using FallbacksFixtureConnect = TaskTestBase; -TEST_F(FallbacksFixtureConnect, DISABLED_ConnectStageInsideFallbacks) { +TEST_F(FallbacksFixtureConnect, connectStageInsideFallbacks) { t.add(std::make_unique(PredefinedCosts({ 1.0, 2.0 }))); auto fallbacks = std::make_unique("Fallbacks");