Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12178

ReadCacheTest flakes on Windows

Details

    Description

      Example failure: https://github.com/apache/beam/pull/14382/checks?check_run_id=2325304757

      ________________________ ReadCacheTest.test_read_cache ________________________
      [gw4] win32 -- Python 3.6.8 d:\a\beam\beam\sdks\python\target\.tox\py36-win\scripts\python.exe
      
      self = <apache_beam.runners.interactive.caching.read_cache_test.ReadCacheTest testMethod=test_read_cache>
      
          def setUp(self):
      >     ie.new_env()
      
      apache_beam\runners\interactive\caching\read_cache_test.py:37: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      apache_beam\runners\interactive\interactive_environment.py:119: in new_env
          _interactive_beam_env.cleanup()
      apache_beam\runners\interactive\interactive_environment.py:269: in cleanup
          self.evict_recording_manager(pipeline)
      apache_beam\runners\interactive\interactive_environment.py:396: in evict_recording_manager
          rm.clear()
      apache_beam\runners\interactive\recording_manager.py:339: in clear
          cache_manager.cleanup()
      apache_beam\runners\interactive\caching\streaming_cache.py:385: in cleanup
          shutil.rmtree(self._cache_dir)
      c:\hostedtoolcache\windows\python\3.6.8\x64\lib\shutil.py:500: in rmtree
          return _rmtree_unsafe(path, onerror)
      c:\hostedtoolcache\windows\python\3.6.8\x64\lib\shutil.py:390: in _rmtree_unsafe
          _rmtree_unsafe(fullname, onerror)
      c:\hostedtoolcache\windows\python\3.6.8\x64\lib\shutil.py:395: in _rmtree_unsafe
          onerror(os.unlink, fullname, sys.exc_info())
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      
      path = 'D:\\a\\beam\\beam\\sdks\\python\\target\\.tox\\py36-win\\tmp\\it-3ggiapgo2494199486000\\full'
      onerror = <function rmtree.<locals>.onerror at 0x00000244BA770A60>
      
          def _rmtree_unsafe(path, onerror):
              try:
                  if os.path.islink(path):
                      # symlinks to directories are forbidden, see bug #1669
                      raise OSError("Cannot call rmtree on a symbolic link")
              except OSError:
                  onerror(os.path.islink, path, sys.exc_info())
                  # can't continue even if onerror hook returns
                  return
              names = []
              try:
                  names = os.listdir(path)
              except OSError:
                  onerror(os.listdir, path, sys.exc_info())
              for name in names:
                  fullname = os.path.join(path, name)
                  try:
                      mode = os.lstat(fullname).st_mode
                  except OSError:
                      mode = 0
                  if stat.S_ISDIR(mode):
                      _rmtree_unsafe(fullname, onerror)
                  else:
                      try:
      >                   os.unlink(fullname)
      E                   PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\a\\beam\\beam\\sdks\\python\\target\\.tox\\py36-win\\tmp\\it-3ggiapgo2494199486000\\full\\dacc5c76b6-2494199456376-2494201991240-2494199486000'
      

      Attachments

        Issue Links

          Activity

            People

              ningk Ning
              bhulette Brian Hulette
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 50m
                  2h 50m