DataBiosphere / toil

A scalable, efficient, cross-platform (Linux/macOS) and easy-to-use workflow engine in pure Python.
http://toil.ucsc-cgl.org/.
Apache License 2.0
900 stars 240 forks source link

jobServiceTest fails when run within PyCharm #268

Closed hannes-ucsc closed 9 years ago

hannes-ucsc commented 9 years ago

PyCharm

/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Applications/PyCharm.app/Contents/helpers/pycharm/utrunner.py /Users/hannes/workspace/bd2k/toil/src/toil/test/src/jobServiceTest.py true
Testing started at 2:18 PM ...
INFO:toil.lib.bioio:Logging set at level: INFO
INFO:toil.lib.bioio:Parsed arguments
INFO:toil.test:Setting up jobServiceTest.JobServiceTest.testService
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src/toil/test/src', name='jobServiceTest', extension='.pyc').
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src/toil/test/src', name='jobServiceTest', extension='.pyc').
INFO:toil.lib.bioio:Logging set at level: INFO
INFO:toil.common:Using the single machine batch system
INFO:toil.jobStores.fileJobStore:Jobstore directory is: /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/f6d95afa-1170-4f3d-ae19-2724bcb8160f
WARNING:toil.batchSystems.singleMachine:Limiting maxCpus to CPU count of system (8).
INFO:toil.batchSystems.singleMachine:Setting up the thread pool with 80 workers, given a minimum CPU fraction of 0.100000 and a maximum CPU value of 8.
INFO:toil.common:Written the environment for the jobs to the environment file
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src', name='toil.job', extension='.pyc').
INFO:toil.leader:Checked batch system has no running jobs and no updated jobs
INFO:toil.leader:Found 1 jobs to start and 0 jobs with successors to run
INFO:toil.leader:Starting the main loop
INFO:toil.batchSystems.singleMachine:Executing command: '/usr/local/opt/python/bin/python2.7 -E /Users/hannes/workspace/bd2k/toil/src/toil/worker.py /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/f6d95afa-1170-4f3d-ae19-2724bcb8160f z/X/job_402EO'.
WARNING:toil.leader:The job seems to have left a log file, indicating failure: z/X/job_402EO
WARNING:toil.leader:Reporting file: z/X/job_402EO
WARNING:toil.leader:z/X/job_402EO:  ---TOIL WORKER OUTPUT LOG---
WARNING:toil.leader:z/X/job_402EO:  Traceback (most recent call last):
WARNING:toil.leader:z/X/job_402EO:    File "/Users/hannes/workspace/bd2k/toil/src/toil/worker.py", line 271, in main
WARNING:toil.leader:z/X/job_402EO:      messages = loadJob(job.command, jobStore)._execute( jobWrapper=job,
WARNING:toil.leader:z/X/job_402EO:    File "/Users/hannes/workspace/bd2k/toil/src/toil/worker.py", line 85, in loadJob
WARNING:toil.leader:z/X/job_402EO:      return cPickle.load( fileHandle )
WARNING:toil.leader:z/X/job_402EO:  ImportError: No module named jobServiceTest
WARNING:toil.leader:z/X/job_402EO:  Exiting the worker because of a failed job on host hannes-mbpr
WARNING:toil.leader:z/X/job_402EO:  ERROR:__main__:Exiting the worker because of a failed job on host hannes-mbpr
WARNING:toil.leader:z/X/job_402EO:  WARNING:toil.jobWrapper:Due to failure we are reducing the remaining retry count of job z/X/job_402EO to 0
WARNING:toil.leader:Job: z/X/job_402EO is completely failed
INFO:toil.leader:Only failed jobs and their dependents (1 total) are remaining, so exiting.
INFO:toil.leader:Finished the main loop
INFO:toil.leader:Waiting for stats and logging collator process to finish
INFO:toil.leader:Stats/logging finished collating in 0.326298952103 seconds

Failure
Traceback (most recent call last):
  File "/Users/hannes/workspace/bd2k/toil/src/toil/test/src/jobServiceTest.py", line 29, in testService
    self.assertEquals(Job.Runner.startToil(t, options), 0)
AssertionError: 1 != 0

INFO:toil.test:Tearing down down jobServiceTest.JobServiceTest.testService

Process finished with exit code 0

Command line (via unittest):

hannes-mbpr:toil hannes$ python -m unittest toil.test.src.jobServiceTest
INFO:toil.lib.bioio:Logging set at level: INFO
INFO:toil.lib.bioio:Parsed arguments
INFO:toil.test:Setting up toil.test.src.jobServiceTest.JobServiceTest.testService
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src', name='toil.test.src.jobServiceTest', extension='.pyc').
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src', name='toil.test.src.jobServiceTest', extension='.pyc').
INFO:toil.lib.bioio:Logging set at level: INFO
INFO:toil.common:Using the single machine batch system
INFO:toil.jobStores.fileJobStore:Jobstore directory is: /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/170db835-32ad-4c31-91d1-c679fc917c75
WARNING:toil.batchSystems.singleMachine:Limiting maxCpus to CPU count of system (8).
INFO:toil.batchSystems.singleMachine:Setting up the thread pool with 80 workers, given a minimum CPU fraction of 0.100000 and a maximum CPU value of 8.
INFO:toil.common:Written the environment for the jobs to the environment file
WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src', name='toil.job', extension='.pyc').
INFO:toil.leader:Checked batch system has no running jobs and no updated jobs
INFO:toil.leader:Found 1 jobs to start and 0 jobs with successors to run
INFO:toil.leader:Starting the main loop
INFO:toil.batchSystems.singleMachine:Executing command: '/usr/local/opt/python/bin/python2.7 -E /Users/hannes/workspace/bd2k/toil/src/toil/worker.py /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/170db835-32ad-4c31-91d1-c679fc917c75 Z/b/jobRS23XZ'.
INFO:toil.batchSystems.singleMachine:Executing command: '/usr/local/opt/python/bin/python2.7 -E /Users/hannes/workspace/bd2k/toil/src/toil/worker.py /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/170db835-32ad-4c31-91d1-c679fc917c75 1/c/jobxwKMmE'.
INFO:toil.batchSystems.singleMachine:Executing command: '/usr/local/opt/python/bin/python2.7 -E /Users/hannes/workspace/bd2k/toil/src/toil/worker.py /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/170db835-32ad-4c31-91d1-c679fc917c75 t/k/jobPC9FWZ'.
INFO:toil.batchSystems.singleMachine:Executing command: '/usr/local/opt/python/bin/python2.7 -E /Users/hannes/workspace/bd2k/toil/src/toil/worker.py /var/folders/fs/wgp0_xr91c9bwnztwfm8scsh0000gn/T/170db835-32ad-4c31-91d1-c679fc917c75 Z/b/jobRS23XZ'.
INFO:toil.leader:Only failed jobs and their dependents (0 total) are remaining, so exiting.
INFO:toil.leader:Finished the main loop
INFO:toil.leader:Waiting for stats and logging collator process to finish
INFO:toil.leader:Stats/logging finished collating in 0.0553569793701 seconds
INFO:toil.test:Tearing down down toil.test.src.jobServiceTest.JobServiceTest.testService
.
----------------------------------------------------------------------
Ran 1 test in 2.542s

OK
hannes-ucsc commented 9 years ago

Note how the module descriptors differ between the two cases:

WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src/toil/test/src', name='jobServiceTest', extension='.pyc').

vs.

WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/Users/hannes/workspace/bd2k/toil/src', name='toil.test.src.jobServiceTest', extension='.pyc').
hannes-ucsc commented 9 years ago

This will be followed-up in #272.