Skip to content

Commit

Permalink
Merge pull request #17734 from mpoindexter/feature/fix-race-in-inspect-2
Browse files Browse the repository at this point in the history
Feature/fix race in inspect
  • Loading branch information
andresriancho committed Mar 29, 2019
2 parents f5adc9e + d473ed1 commit b4dca23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions w3af/core/controllers/threads/tests/test_threadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def test_change_number_of_workers_requirement(self):

def test_worker_stats_idle(self):
worker_pool = Pool(processes=1, worker_names='WorkerThread')
func_name, func_args = worker_pool._pool[0].worker.get_real_func_name_args()
self.assertIsNone(func_name)
self.assertIsNone(func_args)
self.assertTrue(worker_pool._pool[0].worker.is_idle())

def test_worker_stats_not_idle(self):
Expand Down
6 changes: 3 additions & 3 deletions w3af/core/controllers/threads/threadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ def get_real_func_name_args(self):
current_args = current_args[0][1:]

if isinstance(current_func, return_args):
return current_func.func_orig.__name__
return current_func.func_orig.__name__, current_args

if isinstance(current_func, one_to_many):
return current_func.func_orig.__name__
return current_func.func_orig.__name__, current_args

if current_func is None:
return None
return None, None

return current_func.__name__, current_args

Expand Down

0 comments on commit b4dca23

Please sign in to comment.