Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent test validation on Win10 #9

Open
sfaleron opened this issue May 17, 2021 · 1 comment
Open

Inconsistent test validation on Win10 #9

sfaleron opened this issue May 17, 2021 · 1 comment

Comments

@sfaleron
Copy link

sfaleron commented May 17, 2021

Running test_semidbm2.py results in 0, 1, or 2 errors.
The errors are always OSError: can't rename file, error: 1175
I'm using the Official Build from python.org. The semidbm2 version was from the master branch today, 20210517.
FWIW, running under Cygwin on the same machine does not seem to fail, or at least the rate is much smaller :/, although the noisy warnings are pretty much the same.

Full capture:

(venv) λ python -VV
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]

(venv) λ python test_semidbm2.py
.............C:\Users\chrifull\AppData\Local\Programs\Python\Python39\lib\traceback.py:220: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_utuvljr1u9\\myfile.db\\data'>
  tb.tb_frame.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
..C:\Users\chrifull\dev\semidbm2\test_semidbm2.py:246: ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_utc0z4darw\\myfile.db\\data' mode='r' encoding='cp1252'>
  self.assertEqual(len(open(db._data_filename).read()), 8)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.......C:\Users\chrifull\AppData\Local\Programs\Python\Python39\lib\traceback.py:220: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_ut7als9tb_\\myfile.db\\data'>
  tb.tb_frame.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
............C:\Users\chrifull\dev\semidbm2\test_semidbm2.py:301: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(db2["foobar"], b"foobar")
.......C:\Users\chrifull\dev\semidbm2\test_semidbm2.py:246: ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_uthr2ra6nk\\myfile.db\\data' mode='r' encoding='cp1252'>
  self.assertEqual(len(open(db._data_filename).read()), 8)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
........................C:\Users\chrifull\AppData\Local\Programs\Python\Python39\lib\traceback.py:220: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_utypsva8e4\\myfile.db\\data'>

  tb.tb_frame.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
..C:\Users\chrifull\dev\semidbm2\test_semidbm2.py:246: ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_ut_f1klsho\\myfile.db\\data' mode='r' encoding='cp1252'>
  self.assertEqual(len(open(db._data_filename).read()), 8)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
..E....C:\Users\chrifull\AppData\Local\Programs\Python\Python39\lib\traceback.py:220: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\chrifull\\AppData\\Local\\Temp\\semidbm_utf8xj3s8b\\myfile.db\\data'>
  tb.tb_frame.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
....................
======================================================================
ERROR: test_compaction_does_not_leave_behind_files (__main__.TestWithChecksumsOn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\chrifull\dev\semidbm2\test_semidbm2.py", line 198, in test_compaction_does_not_leave_behind_files
    db2.compact()
  File "C:\Users\chrifull\dev\semidbm2\semidbm2\db.py", line 251, in compact
    self._renamer(new_db._data_filename, self._data_filename)
  File "C:\Users\chrifull\dev\semidbm2\semidbm2\db.py", line 325, in __call__
    semidbm2.win32.rename(from_file, to_file)
  File "C:\Users\chrifull\dev\semidbm2\semidbm2\win32.py", line 21, in rename
    raise OSError("can't rename file, error: %s" % kernel32.GetLastError())
OSError: can't rename file, error: 1175

----------------------------------------------------------------------
Ran 94 tests in 1.144s

FAILED (errors=1)
@JelleZijlstra
Copy link
Contributor

Error 1175 is apparently ERROR_UNABLE_TO_REMOVE_REPLACED. We don't generally use Windows so I don't have much insight here, sorry. It could be a local permissions issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants