Commit d59dd2362cb7934bdad15370aa044a032d36525f
1 parent
1049ca96
Exists in
dev
bugfix TEST_MAX_DURATION_SEC
Showing
5 changed files
with
9 additions
and
13 deletions
Show diff stats
CHANGELOG
VERSION
privatedev/plugin/agent/AgentBasic.py
... | ... | @@ -28,7 +28,7 @@ class AgentBasic(Agent): |
28 | 28 | # Run the assertion tests at the end |
29 | 29 | TEST_WITH_FINAL_TEST = False |
30 | 30 | #TEST_MAX_DURATION_SEC = None |
31 | - TEST_MAX_DURATION_SEC = 100 | |
31 | + TEST_MAX_DURATION_SEC = 400 | |
32 | 32 | # Who should I send commands to ? |
33 | 33 | TEST_COMMANDS_DEST = "myself" |
34 | 34 | #TEST_COMMANDS_DEST = "AgentB" | ... | ... |
src/core/pyros_django/agent/Agent.py
... | ... | @@ -1089,7 +1089,8 @@ class Agent: |
1089 | 1089 | self.__set_and_log_status(self.AGT_STATUS.IN_MAIN_LOOP_START) |
1090 | 1090 | |
1091 | 1091 | self.__main_loop_start(nb_iter) |
1092 | - #if not self.DO_MAIN_LOOP: return | |
1092 | + # TEST mode only | |
1093 | + if not self.DO_MAIN_LOOP: return | |
1093 | 1094 | |
1094 | 1095 | self.__reload_config_if_changed() # only if changed |
1095 | 1096 | |
... | ... | @@ -1224,7 +1225,7 @@ class Agent: |
1224 | 1225 | if self.__CCE: |
1225 | 1226 | log.info('-'*6 + "CMD finished WITH EXCEPTION ") |
1226 | 1227 | self.__process_exception(self.CCE) |
1227 | - self.__CCE = None | |
1228 | + #self.__CCE = None | |
1228 | 1229 | # Check current cmd res and status ONLY if in test mode and cmd sent by myself |
1229 | 1230 | #if self.is_in_test_mode() and self.__CC.sender==self.__class__.__name__ : |
1230 | 1231 | if self.is_in_test_mode(): |
... | ... | @@ -1383,10 +1384,9 @@ class Agent: |
1383 | 1384 | # (Test only) |
1384 | 1385 | # EXIT because max duration reached ? |
1385 | 1386 | if self.TEST_MODE and self.TEST_MAX_DURATION_SEC and (time.time()-self.start_time > self.TEST_MAX_DURATION_SEC): |
1386 | - print("Exit because of max duration set to " + str(self.TEST_MAX_DURATION_SEC) + "s") | |
1387 | 1387 | log.info("Exit because of max duration set to " + str(self.TEST_MAX_DURATION_SEC) + "s") |
1388 | 1388 | #self._kill_running_device_cmd_if_exists(self.name) |
1389 | - self.__cleanup_before_exit(self.name) | |
1389 | + ##self.__cleanup_before_exit(self.name) | |
1390 | 1390 | #if self.TEST_MODE and self.TEST_WITH_FINAL_TEST: self._TEST_test_results() |
1391 | 1391 | self.DO_MAIN_LOOP = False |
1392 | 1392 | return |
... | ... | @@ -2386,9 +2386,6 @@ class Agent: |
2386 | 2386 | |
2387 | 2387 | # Replace low level exception with high level one (CmdExceptionBadArgs) |
2388 | 2388 | except (TypeError, AttributeError, ValueError, CmdExceptionBadArgs, AssertionError) as e: |
2389 | - print("EXCEPTION !!!") | |
2390 | - print(type(e)) | |
2391 | - print(e) | |
2392 | 2389 | # set back to PENDING because this command should never has been RUNNING |
2393 | 2390 | cmd.set_as_pending() |
2394 | 2391 | raise CmdExceptionBadArgs(cmd) from None |
... | ... | @@ -2404,7 +2401,6 @@ class Agent: |
2404 | 2401 | ##tb = sys.exc_info()[2] |
2405 | 2402 | ##raise AgentCmdUnimplementedException(cmd).with_traceback(tb) |
2406 | 2403 | ##raise AgentCmdUnimplementedException(cmd).with_traceback(None) |
2407 | - print("YESSS") | |
2408 | 2404 | |
2409 | 2405 | |
2410 | 2406 | ... | ... |
src/core/pyros_django/agent/AgentBasic.py
... | ... | @@ -28,7 +28,7 @@ class AgentBasic(Agent): |
28 | 28 | # Run the assertion tests at the end |
29 | 29 | TEST_WITH_FINAL_TEST = False |
30 | 30 | #TEST_MAX_DURATION_SEC = None |
31 | - TEST_MAX_DURATION_SEC = 100 | |
31 | + TEST_MAX_DURATION_SEC = 400 | |
32 | 32 | # Who should I send commands to ? |
33 | 33 | TEST_COMMANDS_DEST = "myself" |
34 | 34 | #TEST_COMMANDS_DEST = "AgentB" | ... | ... |