Skip to content

Commit 600c971

Browse files
Add conditional assertions to status check (#5873) (#5877)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 05f9fa1 commit 600c971

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/Tests/XPack/Sql/SqlSearchApiCoordinatedTests.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,20 @@ [I] public async Task SqlSearchStatusResponse() => await Assert<SqlSearchStatusR
114114
{
115115
r.ShouldBeValid();
116116
r.Id.Should().NotBeNullOrEmpty();
117-
r.IsPartial.Should().BeTrue();
118-
r.IsRunning.Should().BeTrue();
117+
118+
if (r.CompletionStatus.HasValue)
119+
{
120+
r.IsPartial.Should().BeFalse();
121+
r.IsRunning.Should().BeFalse();
122+
}
123+
else
124+
{
125+
r.IsPartial.Should().BeTrue();
126+
r.IsRunning.Should().BeTrue();
127+
r.StartTimeInMillis.Should().BeGreaterThan(0);
128+
}
129+
119130
r.ExpirationTimeInMillis.Should().BeGreaterThan(0);
120-
r.StartTimeInMillis.Should().BeGreaterThan(0);
121131
});
122132

123133
[I] public async Task SqlGetResponse() => await Assert<SqlGetResponse>(GetStep, r =>

0 commit comments

Comments
 (0)