implementing error and event tests and delayed event delivery