mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Bug: When WatchStaticMappings=true throws exceptions on updating the mapping files #183
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 @muzammilkm on GitHub (Jun 20, 2019).
When WatchStaticMappings = true in settings throws exceptions & application abnormally gets aborted on updating the mapping files while Mock Server is running.
Exception:
This happens due to editor lock duration while writing to disk(saving). I tried capturing the duration for various editors
VS Code: ~400 ms - ~100 ms
Sublime: ~250ms - ~100 ms
Notepad: ~50ms - ~10ms.
Finding the lock duration & work around for this issue, added in WireMock.Net\Server\FluentMockServer.Admin.cs in ReadStaticMappingAndAddOrUpdate method at line 215:
Refer for IsFileLocked
Avoiding File Concurrency when using System.IO.FileSystemWatcher
@StefH commented on GitHub (Jun 20, 2019):
I noticed this also in another scenario. I will check the code...
@StefH commented on GitHub (Jun 20, 2019):
Should be solved in next preview version at MyGet...
@StefH commented on GitHub (Jun 22, 2019):
@muzammilkm Can you verify if this works?
@muzammilkm commented on GitHub (Jun 26, 2019):
Verified.
When can we expect nuget package ?
@StefH commented on GitHub (Jun 26, 2019):
Next week Wednesday.
@StefH commented on GitHub (Jul 3, 2019):
https://github.com/WireMock-Net/WireMock.Net/pull/286