tests: sort events based on their time

This hopefully resolves #49