message: ignore cache write EPERM errors on windows
  if we're reasonably sure they came from a cross-process race condition
diff: @@ -402,6 +402,10 @@ const writeCacheFile = (cachePath: Path, fileData: string) => {
  try {
  writeFileAtomic.sync(cachePath, fileData, {encoding: 'utf8'});
  } catch (e) {
  + if (cacheWriteErrorSafeToIgnore(e, cachePath)) {
  + return;
  + }
  +
  e.message =
  'jest: failed to cache transform results in: ' +
  cachePath +
  @@ -412,6 +416,20 @@ const writeCacheFile = (cachePath: Path, fileData: string) => {
  }
  };
  +/**
  + * On Windows, renames are not atomic, leading to EPERM exceptions when two
  + * processes attempt to rename to the same target file at the same time.
  + * If the target file exists we can be reasonably sure another process has
  + * legitimately won a cache write race and ignore the error.
  + */
  +const cacheWriteErrorSafeToIgnore = (e: Error, cachePath: Path) => {
  + return (
  + process.platform === 'win32' &&
  + e.code === 'EPERM' &&
  + fs.existsSync(cachePath)
  + );
  +};
  +
  const readCacheFile = (cachePath: Path): ?string => {
  if (!fs.existsSync(cachePath)) {
  return null;
  