Fix circular rollout dependencies (#1337)
* Do some refactoring to fix dependencies between rollout management, executor and evaluator beans. * Move rollout retrieving in same transaction as execution. * Do some refactoring. Extend logging and exception handling. * Remove unnecessary transactional and validation annotations. * remove catching never thrown bean * Fix new rollout handling API
This commit is contained in:
@@ -39,6 +39,7 @@ import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||
import org.eclipse.hawkbit.repository.RolloutGroupManagement;
|
||||
import org.eclipse.hawkbit.repository.RolloutHandler;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement;
|
||||
@@ -181,6 +182,9 @@ public abstract class AbstractIntegrationTest {
|
||||
@Autowired
|
||||
protected RolloutManagement rolloutManagement;
|
||||
|
||||
@Autowired
|
||||
protected RolloutHandler rolloutHandler;
|
||||
|
||||
@Autowired
|
||||
protected RolloutGroupManagement rolloutGroupManagement;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RolloutHandler;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement;
|
||||
@@ -177,6 +178,9 @@ public class TestdataFactory {
|
||||
@Autowired
|
||||
private RolloutManagement rolloutManagement;
|
||||
|
||||
@Autowired
|
||||
private RolloutHandler rolloutHandler;
|
||||
|
||||
@Autowired
|
||||
private QuotaManagement quotaManagement;
|
||||
|
||||
@@ -1202,7 +1206,7 @@ public class TestdataFactory {
|
||||
groupSize, confirmationRequired, conditions);
|
||||
|
||||
// Run here, because Scheduler is disabled during tests
|
||||
rolloutManagement.handleRollouts();
|
||||
rolloutHandler.handleAll();
|
||||
|
||||
return rolloutManagement.get(rollout.getId()).get();
|
||||
}
|
||||
@@ -1253,7 +1257,7 @@ public class TestdataFactory {
|
||||
rolloutManagement.start(rollout.getId());
|
||||
|
||||
// Run here, because scheduler is disabled during tests
|
||||
rolloutManagement.handleRollouts();
|
||||
rolloutHandler.handleAll();
|
||||
|
||||
return reloadRollout(rollout);
|
||||
}
|
||||
@@ -1350,9 +1354,9 @@ public class TestdataFactory {
|
||||
public Rollout createSoftDeletedRollout(final String prefix) {
|
||||
final Rollout newRollout = createRollout(prefix);
|
||||
rolloutManagement.start(newRollout.getId());
|
||||
rolloutManagement.handleRollouts();
|
||||
rolloutHandler.handleAll();
|
||||
rolloutManagement.delete(newRollout.getId());
|
||||
rolloutManagement.handleRollouts();
|
||||
rolloutHandler.handleAll();
|
||||
return newRollout;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user