Test if Future is done in order to avoid CancellationException