Description
Currently there are lot of Thread.sleep calls in mock iaas component which makes it slow and cause unexpected behavior due to concurrency issues. Also it has a significant performance overhead when running integration tests since mock iaas is being used for test cases. I've been working on improving this component by doing following changes;
- Remove all Thread sleep calls in mock iaas
- Introduce a method named 'initialize' to start event receivers and publishers. This is a synchronous call which grantees that receiver and publisher objects will be created successfully. If not it will throw an exception and startInstance() method call in CC will fail. Earlier this task was delegated to an executor service which made it difficult to check whether mock instance was created successfully.
- Create topology receiver in mock instance and listen for member initialized and member started events. It will publish instance started and instance activated events based on topology events received rather than sleeping for some time interval before publishing.