Check for correct thread in tests