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

Avoid subprocess for Windows tests #1599

Merged
merged 4 commits into from
Feb 20, 2021
Merged

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Feb 18, 2021

Two tests were failing on Windows because subprocess does not resolve .bat in the dispatcher name.

  1. test_plot_reflections.py is converted here to use procrunner, which fixes that issue.
  2. test_find_spots_server_client.py is disabled on Windows, because dials.find_spots_server does not work there.

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #1599 (dbac4d1) into master (7613ba6) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #1599      +/-   ##
==========================================
- Coverage   66.62%   66.62%   -0.01%     
==========================================
  Files         614      614              
  Lines       68725    68727       +2     
  Branches     9567     9568       +1     
==========================================
  Hits        45789    45789              
- Misses      21008    21009       +1     
- Partials     1928     1929       +1     

@Anthchirp
Copy link
Member

dials.find_spots_server does not work there.

...why is that?

@dagewa
Copy link
Member Author

dagewa commented Feb 20, 2021

On an account with Administrator privileges to avoid issues with opening sockets, I still get:

c:\Users\fcx32934\sw\cctbx>dials.find_spots_server
Sat Feb 20 11:25:29 2021 Serving 20 processes on port 1701
Traceback (most recent call last):
  File "c:\Users\fcx32934\sw\cctbx\build\..\modules\dials\command_line\find_spots_server.py", line 344, in <module>
    run()
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "c:\Users\fcx32934\sw\cctbx\build\..\modules\dials\command_line\find_spots_server.py", line 340, in run
    main(params.nproc, params.port)
  File "c:\Users\fcx32934\sw\cctbx\build\..\modules\dials\command_line\find_spots_server.py", line 318, in main
    proc.start()
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: Please report this error to dials-support@lists.sourceforge.net: cannot pickle '_thread.lock' object

c:\Users\fcx32934\sw\cctbx>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\spawn.py", line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File "c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
PermissionError: [WinError 5] Access is denied

@dagewa
Copy link
Member Author

dagewa commented Feb 20, 2021

Actually it's exactly the same error on my non-admin account. Looks like the usual Windows multiprocessing issues.

@Anthchirp
Copy link
Member

ah okay, so it's just exactly the same problem as on MacOS with Python 3.8+

@Anthchirp Anthchirp merged commit 278f7f7 into master Feb 20, 2021
@Anthchirp Anthchirp deleted the procrunner-for-bat-files branch February 20, 2021 19:45
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

Successfully merging this pull request may close these issues.

None yet

3 participants