InvalidSnapshotTest.testSnapshot starts an instance of ZooKeeperServer on the version-controlled invalidsnap directory, which, as a side-effect, "fixes" the following snapshot—which is broken on purpose (see
This status quo creates a number of problems:
- It makes the test ineffective after the first run;
- The file shows as modified in version control tools, which can be annoying;
- The "fixed" snapshot can end up being committed by mistake, invalidating the test.
(#3 is not theoretical; that "fixed" snapshot frequently shows up in pull requests, and was recently merged into master.).