Add temporal solution for race condition in HandlerTest

Change-Id: I90e9ac11efa763e7263f870b7248e9ccd76e2839
Add remove method for event and error functions in HandlerTest

Change-Id: I39587263669cfb637041e2139868c5f766715a56