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

Parallel testing freezes on Windows when invoked with --with-xunit #9

Open
NickAb opened this issue Oct 8, 2015 · 1 comment
Open

Comments

@NickAb
Copy link
Contributor

NickAb commented Oct 8, 2015

On Windows running lode_runner with both --with-xunit and --processes>0 will result in test runner freezing:

(wp4_10) D:\Projects\sabers_wp4>lode_runner wp4\tests\test_musttest.py --with-xunit --processes=2
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 381, in main
    self = load(from_parent)
  File "C:\Python27-10\Lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\Python27-10\Lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Python27-10\Lib\pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "C:\Python27-10\Lib\pickle.py", line 1124, in find_class
    __import__(module)
  File "C:\Users\n.abalov\Envs\wp4_10\lib\site-packages\lode_runner\xunit.py", line 12, in <module>
    MANAGER = multiprocessing.Manager()
  File "C:\Python27-10\Lib\multiprocessing\__init__.py", line 99, in Manager
    m.start()
  File "C:\Python27-10\Lib\multiprocessing\managers.py", line 524, in start
    self._process.start()
  File "C:\Python27-10\Lib\multiprocessing\process.py", line 130, in start
    self._popen = Popen(self)
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 258, in __init__
    cmd = get_command_line() + [rhandle]
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 358, in get_command_line
    is not going to be frozen to produce a Windows executable.''')
RuntimeError:
            Attempt to start a new process before the current process
            has finished its bootstrapping phase.

            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:

                if __name__ == '__main__':
                    freeze_support()
                    ...

            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 381, in main
    self = load(from_parent)
  File "C:\Python27-10\Lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\Python27-10\Lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Python27-10\Lib\pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "C:\Python27-10\Lib\pickle.py", line 1124, in find_class
    __import__(module)
  File "C:\Users\n.abalov\Envs\wp4_10\lib\site-packages\lode_runner\xunit.py", line 12, in <module>
    MANAGER = multiprocessing.Manager()
  File "C:\Python27-10\Lib\multiprocessing\__init__.py", line 99, in Manager
    m.start()
  File "C:\Python27-10\Lib\multiprocessing\managers.py", line 524, in start
    self._process.start()
  File "C:\Python27-10\Lib\multiprocessing\process.py", line 130, in start
    self._popen = Popen(self)
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 258, in __init__
    cmd = get_command_line() + [rhandle]
  File "C:\Python27-10\Lib\multiprocessing\forking.py", line 358, in get_command_line
    is not going to be frozen to produce a Windows executable.''')
RuntimeError:
            Attempt to start a new process before the current process
            has finished its bootstrapping phase.

            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:

                if __name__ == '__main__':
                    freeze_support()
                    ...

            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.

@nwlunatic
Copy link
Contributor

Is it the same using script call, not a frozen exe?

something like:

C:\Python27-10\python.exe C:\Python27-10\Scripts\lode_runner.py wp4\tests\test_musttest.py --with-xunit --processes=2

or using run function?

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