TRUNK-2695: Testing that executing tasks are not re-scheduled. Some tests fail due to a violation of a DB constraint when creating test data. To be continued.
TRUNK-2695 implementing changes suggested in code review
TRUNK-2695 removed comments related to debugging