Skip to content

Commit

Permalink
Add cancelled property to taskinfo (#5803) (#5808)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
  • Loading branch information
github-actions[bot] and stevejgordon authored Jul 6, 2021
1 parent 8bc874c commit 4b46305
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

0 comments on commit 4b46305

Please sign in to comment.