Description
Describe the bug
When the monkey agent starts, it performs a check to see if it has access to the internet. If the agent does not have internet access, this can cause the monkey agent to hang for 30-60 seconds, which adds significant delay to the blackbox test suite. It also slows down the overall propagation of the monkey and delays user feedback.
We've attempted to prevent this check from running by removing the URLs/IPs from the internet_services
config field (#1371), but this did not stop the checks. This is because these checks are run before the agent contacts the island to receive a new configuration. The agent uses the default configuration, which includes the URLs and performs the checks.
As far as I can tell, the agent checks for internet access so it can send this information to the island. However, this information is never used. Below are all of the references to internet_access
that I could find:
monkey/monkey/infection_monkey/monkey.py
Lines 119 to 120 in 33aa8d1
monkey/monkey/infection_monkey/control.py
Lines 43 to 70 in 33aa8d1
I have been unable to find any code that uses the internet_access
field from the monkey model.
To Reproduce
See #1371 for more information
Suggested solutions
I recommend we remove this capability, as it causes delays in monkey propagation and adds no value.
Tasks
- Remove dead code, build binaries, run blackbox tests. Compare before and after runtimes for the whole test suite. (0d) @mssalvatore
- Run a test and inspect reports to ensure nothing broke. (0d) @mssalvatore