Skip to content

Add cancelled property to taskinfo #5803

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

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Nest/Cluster/TaskManagement/GetTask/TaskInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class TaskInfo
[DataMember(Name ="cancellable")]
public bool Cancellable { get; internal set; }

[DataMember(Name ="cancelled")]
public bool? Cancelled { get; internal set; }

[DataMember(Name ="children")]
public IReadOnlyCollection<TaskInfo> Children { get; internal set; } = EmptyReadOnly<TaskInfo>.Collection;

Expand Down
12 changes: 12 additions & 0 deletions tests/Tests/Cluster/TaskManagement/GetTask/GetTaskApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ protected override void ExpectResponse(GetTaskResponse response)
task.StartTimeInMilliseconds.Should().BeGreaterThan(0);
task.RunningTimeInNanoseconds.Should().BeGreaterThan(0);
task.Cancellable.Should().BeTrue();

if (Cluster.ClusterConfiguration.Version >= "7.14.0")
{
task.Cancelled.HasValue.Should().BeTrue();
task.Cancelled.Should().BeFalse();
}
}

protected override void IntegrationSetup(IElasticClient client, CallUniqueValues values)
Expand Down Expand Up @@ -129,6 +135,12 @@ protected override void ExpectResponse(GetTaskResponse response)
task.RunningTimeInNanoseconds.Should().BeGreaterThan(0);
task.Cancellable.Should().BeTrue();

if (Cluster.ClusterConfiguration.Version >= "7.14.0")
{
task.Cancelled.HasValue.Should().BeTrue();
task.Cancelled.Should().BeFalse();
}

var reindexResponse = response.GetResponse<ReindexOnServerResponse>();
reindexResponse.Should().NotBeNull();
reindexResponse.Took.Should().BeGreaterThan(0);
Expand Down