diff --git a/src/Ydb.Sdk/src/Ado/YdbCommand.cs b/src/Ydb.Sdk/src/Ado/YdbCommand.cs index 5feecda3..cec8d5db 100644 --- a/src/Ydb.Sdk/src/Ado/YdbCommand.cs +++ b/src/Ydb.Sdk/src/Ado/YdbCommand.cs @@ -31,7 +31,7 @@ public override async Task ExecuteNonQueryAsync(CancellationToken cancellat { await using var dataReader = await ExecuteReaderAsync(cancellationToken); - while (await dataReader.ReadAsync(cancellationToken)) + while (await dataReader.NextResultAsync(cancellationToken)) { } @@ -51,7 +51,7 @@ public override async Task ExecuteNonQueryAsync(CancellationToken cancellat ? dataReader.IsDBNull(0) ? null : dataReader.GetValue(0) : null; - while (await dataReader.ReadAsync(cancellationToken)) + while (await dataReader.NextResultAsync(cancellationToken)) { } diff --git a/src/Ydb.Sdk/tests/Topic/WriterUnitTests.cs b/src/Ydb.Sdk/tests/Topic/WriterUnitTests.cs index 673cf8e3..a2c1f667 100644 --- a/src/Ydb.Sdk/tests/Topic/WriterUnitTests.cs +++ b/src/Ydb.Sdk/tests/Topic/WriterUnitTests.cs @@ -130,7 +130,8 @@ public async Task Initialize_WhenFailWriteMessage_ShouldRetryInitializeAndReturn Assert.Equal(PersistenceStatus.Written, (await writer.WriteAsync("abacaba")).Status); // check attempt repeated!!! - _mockStream.Verify(stream => stream.Write(It.IsAny()), Times.Exactly(3)); + _mockStream.Verify(stream => stream.Write(It.IsAny()), + Times.AtLeast(2)); // run processing ack may not be able to start on time _mockStream.Verify(stream => stream.MoveNextAsync(), Times.Exactly(3)); _mockStream.Verify(stream => stream.Current, Times.Exactly(2)); } @@ -178,7 +179,8 @@ public async Task Initialize_WhenFailMoveNextAsync_ShouldRetryInitializeAndRetur // check attempt repeated!!! _mockStream.Verify(stream => stream.Write(It.IsAny()), Times.Exactly(3)); - _mockStream.Verify(stream => stream.MoveNextAsync(), Times.Exactly(4)); + _mockStream.Verify(stream => stream.MoveNextAsync(), + Times.AtLeast(3)); // run processing ack may not be able to start on time _mockStream.Verify(stream => stream.Current, Times.Exactly(2)); }