Skip to content

Commit

Permalink
Fix a bug in AwaitNextNotificationAsync that prevented the 'Waited fo… (
Browse files Browse the repository at this point in the history
#5386)

### Changes

Fix a bug in AwaitNextNotificationAsync that prevented the 'Waited for'
log line to show up, to help debug
#5384

### Testing

Since this was a bug in the testing code, I'm OK with not testing it.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
  • Loading branch information
keyboardDrummer committed May 2, 2024
1 parent 075b2a8 commit 55d1c40
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public class TestNotificationReceiver<TNotification> {
}
}

public Task<TNotification> AwaitNextNotificationAsync(CancellationToken cancellationToken) {
public async Task<TNotification> AwaitNextNotificationAsync(CancellationToken cancellationToken) {
var start = DateTime.Now;
try {
return notifications.Dequeue(cancellationToken);
return await notifications.Dequeue(cancellationToken);
} catch (OperationCanceledException) {
var last = History.Any() ? History[^1].Stringify() : "none";
logger.LogInformation($"Waited for {(DateTime.Now - start).Seconds} seconds for new notification.\n" +
Expand Down

0 comments on commit 55d1c40

Please sign in to comment.