Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
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
4 changes: 2 additions & 2 deletions test/Kestrel.FunctionalTests/RequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ await connection.Send(
await appFuncCompleted.Task.DefaultTimeout();
}

mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.Once());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.AtMostOnce());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a point in checking these at all if we allow 0 and 1? Maybe we should just remove them entirely. I suppose we are making sure ConnectionStop is never called more than once still.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's almost no point other than to remind us that there was once a useful assertion here. Be extra careful not to apply these changes to release/2.2 or master when we merge.

}

[Theory]
Expand Down Expand Up @@ -1357,7 +1357,7 @@ await connection.Send(
await Assert.ThrowsAnyAsync<IOException>(() => readTcs.Task).DefaultTimeout();
}

mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.Once());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.AtMostOnce());
}

[Theory]
Expand Down
6 changes: 3 additions & 3 deletions test/Kestrel.FunctionalTests/ResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@ await connection.Send(
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => writeTcs.Task).DefaultTimeout();
}

mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.Once());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.AtMostOnce());
Assert.True(requestAborted);
}

Expand Down Expand Up @@ -3174,7 +3174,7 @@ await connection.Send(
await appFuncCompleted.Task.DefaultTimeout();

mockKestrelTrace.Verify(t => t.ResponseMininumDataRateNotSatisfied(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.Once());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.AtMostOnce());
Assert.False(requestAborted);
}
}
Expand Down Expand Up @@ -3249,7 +3249,7 @@ await connection.Send(
await AssertStreamCompleted(connection.Reader.BaseStream, minTotalOutputSize, targetBytesPerSecond);

mockKestrelTrace.Verify(t => t.ResponseMininumDataRateNotSatisfied(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.Once());
mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny<string>()), Times.AtMostOnce());
Assert.False(requestAborted);
}
}
Expand Down