-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS1998] ClusterHeartbeatReceiverSpec
This async method lacks await
operators
#6699
[CS1998] ClusterHeartbeatReceiverSpec
This async method lacks await
operators
#6699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes
EventFilter.Debug(contains: "- Sequence number [2]") | ||
.ExpectOne(() => heartbeater.Tell(new Heartbeat(Cluster.Get(Sys).SelfAddress, 2, 3))); | ||
await EventFilter.Debug(contains: "- Sequence number [2]") | ||
.ExpectOneAsync(() => { heartbeater.Tell(new Heartbeat(Cluster.Get(Sys).SelfAddress, 2, 3)); return Task.CompletedTask; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default)
public async Task ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default) | |
{ | |
await InternalExpectAsync( | |
actionAsync: action, | |
actorSystem: _actorSystem, | |
expectedCount: 1, | |
timeout: null, | |
cancellationToken: cancellationToken) | |
.ConfigureAwait(false); | |
} |
EventFilter.Debug(contains: "- Sequence number [2] - Creation time [00:00:03]") | ||
.ExpectOne(() => heartbeater.Tell(new HeartbeatRsp(Cluster.Get(Sys).SelfUniqueAddress, 2, 3000000000))); | ||
await EventFilter.Debug(contains: "- Sequence number [2] - Creation time [00:00:03]") | ||
.ExpectOneAsync(() => { heartbeater.Tell(new HeartbeatRsp(Cluster.Get(Sys).SelfUniqueAddress, 2, 3000000000)); return Task.CompletedTask; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default)
public async Task ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default) | |
{ | |
await InternalExpectAsync( | |
actionAsync: action, | |
actorSystem: _actorSystem, | |
expectedCount: 1, | |
timeout: null, | |
cancellationToken: cancellationToken) | |
.ConfigureAwait(false); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):