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

Failing tests on Windows cannot be reproduced #1626

Open
RogerHaase opened this issue Feb 24, 2024 · 0 comments
Open

Failing tests on Windows cannot be reproduced #1626

RogerHaase opened this issue Feb 24, 2024 · 0 comments

Comments

@RogerHaase
Copy link
Member

When tests are run on Windows, there are occasional failures that cannot be reproduced on reruns. On example below FileExistsError: [WinError 183] Cannot create a file when that file already exists:

Workaround is to rerun tests.

================================== FAILURES ===================================
________________________________ test_load_all ________________________________

artifact_dir = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli')
save_all = CompletedProcess(args=['moin', 'save', '-a', '-f', WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/backup.m...d by index rebuild is recommended\r\n2024-02-23 14:05:52,070 INFO moin.cli.maint.serialization:70 Backup finished\r\n')

    def test_load_all(artifact_dir, save_all):
        restore_dir = Path(artifact_dir / 'restore_all')
>       load(restore_dir, 'backup.moin', artifact_dir)

C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:26: in load
    restore_dir.mkdir()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli/restore_all')
mode = 511, parents = False, exist_ok = False

    def mkdir(self, mode=0o777, parents=False, exist_ok=False):
        """
        Create a new directory at this given path.
        """
        try:
>           self._accessor.mkdir(self, mode)
E           FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Clones\\ThomasWaldmann\\moin\\_test_artifacts\\cli\\restore_all'

C:\Users\haase\AppData\Local\Programs\Python\Python310\lib\pathlib.py:1175: FileExistsError
____________________________ test_load_default_ns _____________________________

artifact_dir = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli')
save_default = CompletedProcess(args=['moin', 'save', '-b', 'default', '-f', WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifac...d by index rebuild is recommended\r\n2024-02-23 14:05:55,219 INFO moin.cli.maint.serialization:70 Backup finished\r\n')

    def test_load_default_ns(artifact_dir, save_default):
        moin_dir, _ = get_dirs('')
        welcome_dir = moin_dir / 'src' / 'moin' / 'help' / 'welcome'
        expected_metas = {}
        for data_fn in welcome_dir.glob('*.meta'):
            with open(data_fn) as f:
                meta = json.load(f)
                if meta[NAMESPACE] != '':
                    continue
                name = meta[NAME][0]
                expected_metas[name] = meta
        restore_dir = Path(artifact_dir / 'restore_default')
>       load(restore_dir, 'backup_default.moin', artifact_dir)

C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:61: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:26: in load
    restore_dir.mkdir()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli/restore_default')
mode = 511, parents = False, exist_ok = False

    def mkdir(self, mode=0o777, parents=False, exist_ok=False):
        """
        Create a new directory at this given path.
        """
        try:
>           self._accessor.mkdir(self, mode)
E           FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Clones\\ThomasWaldmann\\moin\\_test_artifacts\\cli\\restore_default'

C:\Users\haase\AppData\Local\Programs\Python\Python310\lib\pathlib.py:1175: FileExistsError
______________________________ test_load_new_ns _______________________________

artifact_dir = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli')
save_default = CompletedProcess(args=['moin', 'save', '-b', 'default', '-f', WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifac...d by index rebuild is recommended\r\n2024-02-23 14:05:55,219 INFO moin.cli.maint.serialization:70 Backup finished\r\n')

    def test_load_new_ns(artifact_dir, save_default):
        restore_dir = Path(artifact_dir / 'restore_new_ns')
>       load(restore_dir, 'backup_default.moin', artifact_dir, ['-o', '', '-n', 'help-en'])

C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Clones\ThomasWaldmann\moin\src\moin\cli\_tests\test_serialization.py:26: in load
    restore_dir.mkdir()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = WindowsPath('C:/Clones/ThomasWaldmann/moin/_test_artifacts/cli/restore_new_ns')
mode = 511, parents = False, exist_ok = False

    def mkdir(self, mode=0o777, parents=False, exist_ok=False):
        """
        Create a new directory at this given path.
        """
        try:
>           self._accessor.mkdir(self, mode)
E           FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Clones\\ThomasWaldmann\\moin\\_test_artifacts\\cli\\restore_new_ns'

C:\Users\haase\AppData\Local\Programs\Python\Python310\lib\pathlib.py:1175: FileExistsError
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

1 participant