diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/FakeAbLegacyTag.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/FakeAbLegacyTag.cs index 4730777a..bd177379 100644 --- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/FakeAbLegacyTag.cs +++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/FakeAbLegacyTag.cs @@ -115,8 +115,13 @@ internal class FakeAbLegacyTag : IAbLegacyTagRuntime /// Test factory for creating fake AbLegacy tags. internal sealed class FakeAbLegacyTagFactory : IAbLegacyTagFactory { - /// Gets the collection of created tags, keyed by tag name. - public Dictionary Tags { get; } = new(StringComparer.OrdinalIgnoreCase); + /// + /// Gets the collection of created tags, keyed by tag name. Concurrent on purpose (#573): the driver's + /// connectivity probe is on by default and creates its S:0 runtime from a thread-pool thread + /// while a test thread creates the tag under test, so a plain + /// here lost inserts (the "given key was not present" flake, ~1 run in 15). + /// + public System.Collections.Concurrent.ConcurrentDictionary Tags { get; } = new(StringComparer.OrdinalIgnoreCase); /// Gets or sets an optional customization function for tag creation. public Func? Customise { get; set; }