mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
[PR #331] [MERGED] Fix: Collection was modified exception #862
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?
📋 Pull Request Information
Original PR: https://github.com/wiremock/WireMock.Net/pull/331
Author: @theramis
Created: 8/22/2019
Status: ✅ Merged
Merged: 8/22/2019
Merged by: @StefH
Base:
master← Head:master📝 Commits (1)
f80debcConvert collection into a new list before enumerating📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
src/WireMock.Net/Server/FluentMockServer.LogEntries.cs(+1 -1)📄 Description
Problem
We are using wiremock as part of our tests and we found that if we have tests running in parallel we sometimes get an error when calling the
FindLogEntriesmethod.Error
Potential Solution
This is my quick attempt at fixing the above issue. By convert the collection into a new list it shouldn't throw an error if the
LogEntriescollection is updated.From a quick google around the
ToListmethod itself isn't thread safe either though. So its possible that while theToListmethod is creating a copy, it fails due to the original collection getting changed.Thoughts?
@StefH
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.