2.0 delete data for passing tests

The first three commits are already in master -- this PR cherry-picks them back to 2.0-maint. The important bit is the last one. We removed the test directory deletion because it causes flaky tests on Windows. This is a better fix to that problem.