Add unit and/or functional tests for RETRIALS and DELAYS
While testing !395 (merged) I found some issues in the code where it handles RETRIALS and DELAYS/DELAYED. It seems our unit & regression tests do not cover that part. We need to add some automated tests for that code