Improve MediumTest and add debug log