When an Automated Test Framework (ATF) Test is completed, the platform should rollback any record which has been created/deleted/updated. However there are times when the rollback does not happen.
1) Nothing gets rolled back. This might occur when there is a record in the [sys_rollback_context] which is left in the 'In progress' (in_progress) or 'Currently rolling back reverting' (reverting). This prevents the platform from executing any other rollback.
2) Some files aren't rolled back. ATF only tracks records that are inserted/updated/deleted in the same session. If something triggers record operations under another session ID then that operation will not be tracked (Workflows, Scheduled jobs...).
For example, a custom workflow with a timer object will always run on a worker thread under 'System'. Any records created by this workflow (after the timer) will not be captured in the rollback context, updates made by the test will.
1) The same script as the one mentioned in the Known Error Article KB0714289 can be used to fix the issue. You must confirm first that the rollback context currently marked as running is not doing anything anymore.
2) As the files are left over after the ATF rollback we can clearly identify the sys_created_by user and logically trace from there. If the record was created by a workflow and this uses a timer then consult with the SM team to determine whether it can be substituted.