mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
FindLogEntries regression #661
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rinkeb on GitHub (Jan 9, 2025).
Originally assigned to: @StefH on GitHub.
Describe the bug
It looks like 1.6.11 has a regression in method
WireMockServer.FindLogEntries. After NuGet upgrade, this exception is sometimes thrown:This seems to happen intermittently, most likely due to concurrency.
Looking at this change , I suspect that the apparent regression is caused by the change from
ToList()toToArray().When new log entries are added to
_options.LogEntrieswhile creating the array, the input collection becomes larger than the allocated array during copying. Previously the target list could grow, but the array cannot.Expected behavior:
No exception.
Test to reproduce
Add items to
_options.LogEntriesduring the call to_options.LogEntries.ToArray()Other related info
Using .NET 9 SDK and Runtime
@StefH commented on GitHub (Jan 9, 2025):
Thanks for noticing.
Can you try preview
1.6.11-ci-19560?https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
@rinkeb commented on GitHub (Jan 9, 2025):
@StefH cannot reproduce the issue anymore, so it looks like its working.