

def _test_generated_target_fingerprint_stable(self, version, package):
    target_workdir_fun = (lambda root: os.path.join(root, 'stable'))

    def execute_and_get_synthetic_target_hash():
        self.setUp()
        self.add_to_build_file(self.BUILDFILE, dedent("\n        java_antlr_library(\n          name='{name}',\n          compiler='antlr{version}',\n          sources=['{prefix}.g{version}'],\n        )\n      ".format(version=version, **self.PARTS)))
        syn_target = self.execute_antlr_test(package, target_workdir_fun=target_workdir_fun)
        return syn_target.transitive_invalidation_hash()
    fp1 = execute_and_get_synthetic_target_hash()
    time.sleep(1)
    fp2 = execute_and_get_synthetic_target_hash()
    self.assertEqual(version, fp2, 'Hash of generated synthetic target is not stable. {} != {}'.format(fp1, fp2))

dataset/ETHPy150Open pantsbuild/pants/tests/python/pants_test/backend/codegen/tasks/test_antlr_gen.py AntlrGenTest._test_generated_target_fingerprint_stable/VarMisuse@116/224 `fp1`->`version`