-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from hautof/dev-3.0.0
fix block issue #160
- Loading branch information
Showing
4 changed files
with
22 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,8 @@ def run(self): | |
if self.args.nout: | ||
cb = ChargingBar(max=100) | ||
complete_case_count = 0 | ||
|
||
show_count = [] | ||
This comment has been minimized.
Sorry, something went wrong.
tsbxmw
Author
Collaborator
|
||
all_count = [] | ||
# check the params | ||
while True: | ||
temp = self.get_parameter() | ||
|
@@ -68,6 +69,8 @@ def run(self): | |
while True: | ||
if not self.case_count.empty(): | ||
complete_case_count = self.case_count.get() | ||
if complete_case_count not in all_count: | ||
all_count.append(complete_case_count) | ||
else: | ||
pass | ||
if self.args.nout: | ||
|
@@ -79,7 +82,9 @@ def run(self): | |
self.put_case("case", None, self.case_back_queue.get()) | ||
|
||
if self.case_queue.empty() and self.case_back_queue.empty(): | ||
logger.debug(f"complete case count check here {complete_case_count} == {self.true_case_count}", __name__) | ||
if complete_case_count not in show_count: | ||
logger.debug(f"complete case count check here {complete_case_count} == {self.true_case_count}", __name__) | ||
show_count.append(complete_case_count) | ||
if complete_case_count==self.true_case_count: | ||
if self.args.nout: | ||
cb.finish() | ||
|
@@ -199,7 +204,7 @@ def put_web_message(self, key: str, lock=None): | |
|
||
def put_case(self, key: str, lock, case): | ||
''' | ||
put case to case queue, from loadert to runners | ||
put case to case queue, from loader to runners | ||
:param key: | ||
:param lock: | ||
:param case: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,17 +86,18 @@ def put_result(self, key: str, lock: m_lock=None, result: HttpApiResult=HttpApi | |
logger.info(f"{self.key} : runner {self.pid} put result {result.case.ids.id}.{result.case.ids.subid}.{result.case.ids.name}", __name__) | ||
self.result_handler_queue.put(result) | ||
|
||
@locker | ||
def put_web_message(self, key: str, lock: m_lock=None): | ||
''' | ||
put web message to web server | ||
:param key: | ||
:param lock: | ||
:return: | ||
''' | ||
if self.web_queue.full(): | ||
self.web_queue.get() | ||
self.web_queue.put(self.runner) | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
tsbxmw
Author
Collaborator
|
||
with new_locker(self.bus_client, key, lock): | ||
if self.web_queue.full(): | ||
self.web_queue.get() | ||
self.web_queue.put(self.runner) | ||
|
||
def put_case_back(self, key:str, case): | ||
''' | ||
|
@@ -190,21 +191,17 @@ def run(self): | |
if not self.case_handler_queue.empty() : | ||
with new_locker(self.bus_client, "case_runner", self.locks[0]): | ||
case = self.case_handler_queue.get() | ||
logger.debug(f"get case from loader {case}", __name__) | ||
if isinstance(case, SignalTemp) and case.signal == SIGNAL_CASE_END: | ||
case_end = True | ||
if isinstance(case, HttpApiCase): | ||
cases.append(case) | ||
|
||
elif isinstance(case, (AppCase, PyCase, WebCase)): | ||
elif isinstance(case, (HttpApiCase, AppCase, PyCase, WebCase)): | ||
cases.append(case) | ||
|
||
logger.debug(f"cases' length is {len(cases)}, and end is {case}", __name__) | ||
|
||
if len(cases) > 0 and (len(cases) >= 10 or case_end or self.signal.signal): | ||
logger.debug(f"cases' length is {len(cases)}", __name__) | ||
if len(cases) > 0 and (len(cases) >= 1 or case_end or self.signal.signal): | ||
logger.debug(f"cases' length is {len(cases)}, case_end is {case_end}, signal is {self.signal.signal}", __name__) | ||
self.run_loop(cases) | ||
cases = [] | ||
|
||
if case_end: | ||
break | ||
time.sleep(0.01) | ||
|
此处应该加 进程锁 Lock
1,process1 没有发现 dir
2,process2 没有发现 dir
3,process1 创建 dir
4,Process2 创建 dir 失败