diff --git a/Directory.Build.props b/Directory.Build.props
index f2ceb237..b4355f96 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,9 +4,9 @@
TreatWarningsAsErrors is ON for every project, src/ and tests alike (#766 ratchet). The solution builds with
0 warnings since #725 (xUnit1051 etc. cleaned), so any new warning, including analyzer ones, now fails the
- build instead of accumulating. The 61 src/ projects also still set it in their own csproj (#606); that is
- redundant but harmless. A project that genuinely needs an exception should suppress the specific warning
- via NoWarn, not turn this off.
+ build instead of accumulating. This is the ONLY place it is set: the per-project copies (#606) were removed
+ (#768), so do not add it back to a csproj. A project that genuinely needs an exception should suppress the
+ specific warning via NoWarn, not turn this off (only the throwaway tools/mem-probe probes opt out).
-->
net10.0
diff --git a/src/Client/ZB.MOM.WW.OtOpcUa.Client.CLI/ZB.MOM.WW.OtOpcUa.Client.CLI.csproj b/src/Client/ZB.MOM.WW.OtOpcUa.Client.CLI/ZB.MOM.WW.OtOpcUa.Client.CLI.csproj
index 03aa382a..fa00ef1c 100644
--- a/src/Client/ZB.MOM.WW.OtOpcUa.Client.CLI/ZB.MOM.WW.OtOpcUa.Client.CLI.csproj
+++ b/src/Client/ZB.MOM.WW.OtOpcUa.Client.CLI/ZB.MOM.WW.OtOpcUa.Client.CLI.csproj
@@ -4,7 +4,6 @@
Exe
net10.0
enable
- true
enable
ZB.MOM.WW.OtOpcUa.Client.CLI
diff --git a/src/Client/ZB.MOM.WW.OtOpcUa.Client.Shared/ZB.MOM.WW.OtOpcUa.Client.Shared.csproj b/src/Client/ZB.MOM.WW.OtOpcUa.Client.Shared/ZB.MOM.WW.OtOpcUa.Client.Shared.csproj
index a2e8e203..4ad02026 100644
--- a/src/Client/ZB.MOM.WW.OtOpcUa.Client.Shared/ZB.MOM.WW.OtOpcUa.Client.Shared.csproj
+++ b/src/Client/ZB.MOM.WW.OtOpcUa.Client.Shared/ZB.MOM.WW.OtOpcUa.Client.Shared.csproj
@@ -3,7 +3,6 @@
net10.0
enable
- true
enable
ZB.MOM.WW.OtOpcUa.Client.Shared
diff --git a/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ZB.MOM.WW.OtOpcUa.Client.UI.csproj b/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ZB.MOM.WW.OtOpcUa.Client.UI.csproj
index db6dcb97..5e5a5e0e 100644
--- a/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ZB.MOM.WW.OtOpcUa.Client.UI.csproj
+++ b/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ZB.MOM.WW.OtOpcUa.Client.UI.csproj
@@ -4,7 +4,6 @@
WinExe
net10.0
enable
- true
enable
ZB.MOM.WW.OtOpcUa.Client.UI
diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/ZB.MOM.WW.OtOpcUa.Cluster.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/ZB.MOM.WW.OtOpcUa.Cluster.csproj
index 2d45cdf5..33fd9f05 100644
--- a/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/ZB.MOM.WW.OtOpcUa.Cluster.csproj
+++ b/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/ZB.MOM.WW.OtOpcUa.Cluster.csproj
@@ -2,7 +2,6 @@
ZB.MOM.WW.OtOpcUa.Cluster
- true
diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Commons/ZB.MOM.WW.OtOpcUa.Commons.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Commons/ZB.MOM.WW.OtOpcUa.Commons.csproj
index bd560b43..eb092910 100644
--- a/src/Core/ZB.MOM.WW.OtOpcUa.Commons/ZB.MOM.WW.OtOpcUa.Commons.csproj
+++ b/src/Core/ZB.MOM.WW.OtOpcUa.Commons/ZB.MOM.WW.OtOpcUa.Commons.csproj
@@ -2,7 +2,6 @@
ZB.MOM.WW.OtOpcUa.Commons
- true
diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/ZB.MOM.WW.OtOpcUa.Configuration.csproj b/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/ZB.MOM.WW.OtOpcUa.Configuration.csproj
index bb99850d..cea5ae4b 100644
--- a/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/ZB.MOM.WW.OtOpcUa.Configuration.csproj
+++ b/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/ZB.MOM.WW.OtOpcUa.Configuration.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/ZB.MOM.WW.OtOpcUa.Driver.AbCip.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/ZB.MOM.WW.OtOpcUa.Driver.AbCip.csproj
index 9398a04a..19f90456 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/ZB.MOM.WW.OtOpcUa.Driver.AbCip.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/ZB.MOM.WW.OtOpcUa.Driver.AbCip.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.AbCip
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.csproj
index 9dbcccee..e9e87216 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.csproj
@@ -3,7 +3,6 @@
net10.0
enable
enable
- true
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/AbLegacyDriver.cs b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/AbLegacyDriver.cs
index 9fdcddf9..c3743077 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/AbLegacyDriver.cs
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/AbLegacyDriver.cs
@@ -217,7 +217,7 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
?? throw new InvalidOperationException(
$"AbLegacy device has invalid HostAddress '{device.HostAddress}' — expected 'ab://gateway[:port]/cip-path'.");
var profile = AbLegacyPlcFamilyProfile.ForFamily(device.PlcFamily);
- devices[device.HostAddress] = new DeviceState(addr, device, profile);
+ devices[device.HostAddress] = new DeviceState(addr, device, profile) { HostStateChangedUtc = Clock() };
}
// Build the RawPath → definition table from the authored raw tags. Each entry's TagConfig
// blob is mapped by the pure factory; the entry's WriteIdempotent flag is threaded onto the
@@ -286,7 +286,7 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
state.ProbeTask = Task.Run(() => ProbeLoopAsync(state, probe, ct), ct);
}
}
- _health = new DriverHealth(DriverState.Healthy, DateTime.UtcNow, null);
+ _health = new DriverHealth(DriverState.Healthy, Clock(), null);
}
}
catch (Exception ex)
@@ -451,9 +451,11 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
internal const int FaultsToMarkDeviceDown = 2;
///
- /// The clock every per-device backoff decision reads (window open? when does it end?). Wall-clock UTC in
- /// production; a test substitutes a manual clock so the window can be crossed deterministically rather than by
- /// sleeping (review 07 r0 M7).
+ /// The clock every per-device backoff decision reads (window open? when does it end?) AND every health stamp
+ /// (LastSuccessfulRead at init / read / write, the read's sample timestamps, host-state change times).
+ /// Wall-clock UTC in production; a test substitutes a manual clock so a window can be crossed, or a stamp proven
+ /// to advance, deterministically rather than by sleeping or spinning (review 07 r0 M7, lmxopcua#768). Set it
+ /// before InitializeAsync for the init stamp to come from it.
///
internal Func Clock { get; set; } = () => DateTime.UtcNow;
@@ -508,7 +510,7 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
{
ArgumentNullException.ThrowIfNull(fullReferences);
var epoch = CurrentEpoch;
- var now = DateTime.UtcNow;
+ var now = Clock();
var results = new DataValueSnapshot[fullReferences.Count];
var devices = _devices; // one snapshot of the published table for the whole call
@@ -1080,7 +1082,7 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
}
outcome.FoldOpaque();
- ApplyHealth(epoch, outcome.FaultMessage, anyGood: outcome.AnyAnswered, anyAnswered: outcome.AnyAnswered, DateTime.UtcNow);
+ ApplyHealth(epoch, outcome.FaultMessage, anyGood: outcome.AnyAnswered, anyAnswered: outcome.AnyAnswered, Clock());
return results;
}
@@ -1230,7 +1232,7 @@ public sealed partial class AbLegacyDriver : IDriver, IReadable, IWritable, ITag
old = state.HostState;
if (old == newState) return;
state.HostState = newState;
- state.HostStateChangedUtc = DateTime.UtcNow;
+ state.HostStateChangedUtc = Clock();
}
if (newState == HostState.Stopped)
_logger.LogWarning(
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.csproj
index 2f7896cd..019681d7 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.AbLegacy
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.csproj
index ad5239ba..ee3a9fe5 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.csproj
@@ -4,7 +4,6 @@
net10.0
enable
enable
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.Calculation
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation/ZB.MOM.WW.OtOpcUa.Driver.Calculation.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation/ZB.MOM.WW.OtOpcUa.Driver.Calculation.csproj
index 0efbc7e0..ea2926ef 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation/ZB.MOM.WW.OtOpcUa.Driver.Calculation.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation/ZB.MOM.WW.OtOpcUa.Driver.Calculation.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.Calculation
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.csproj
index 48b2f1bd..f37cc6bb 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.csproj
@@ -3,7 +3,6 @@
net10.0
enable
enable
- true
ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj
index d8e6892c..a93a9d07 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.csproj
index 55d40545..fec44dec 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.csproj
@@ -4,7 +4,6 @@
net10.0
enable
enable
- true
diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.csproj
index 5c41789a..1fae3113 100644
--- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.csproj
+++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.csproj
@@ -5,7 +5,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
ZB.MOM.WW.OtOpcUa.Driver.TwinCAT
diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ZB.MOM.WW.OtOpcUa.AdminUI.csproj b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ZB.MOM.WW.OtOpcUa.AdminUI.csproj
index 5e79799d..9d241e92 100644
--- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ZB.MOM.WW.OtOpcUa.AdminUI.csproj
+++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ZB.MOM.WW.OtOpcUa.AdminUI.csproj
@@ -3,7 +3,6 @@
ZB.MOM.WW.OtOpcUa.AdminUI
true
- true
diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ZB.MOM.WW.OtOpcUa.ControlPlane.csproj b/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ZB.MOM.WW.OtOpcUa.ControlPlane.csproj
index 36fedc39..a1b2f9ab 100644
--- a/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ZB.MOM.WW.OtOpcUa.ControlPlane.csproj
+++ b/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/ZB.MOM.WW.OtOpcUa.ControlPlane.csproj
@@ -2,7 +2,6 @@
ZB.MOM.WW.OtOpcUa.ControlPlane
- true
diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Host/ZB.MOM.WW.OtOpcUa.Host.csproj b/src/Server/ZB.MOM.WW.OtOpcUa.Host/ZB.MOM.WW.OtOpcUa.Host.csproj
index c76e4184..34a25433 100644
--- a/src/Server/ZB.MOM.WW.OtOpcUa.Host/ZB.MOM.WW.OtOpcUa.Host.csproj
+++ b/src/Server/ZB.MOM.WW.OtOpcUa.Host/ZB.MOM.WW.OtOpcUa.Host.csproj
@@ -4,7 +4,6 @@
ZB.MOM.WW.OtOpcUa.Host
OtOpcUa.Host
zb-mom-ww-otopcua-host
- true
netstandard2.0
enable
- true
latest
false
true
diff --git a/tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests/ZB.MOM.WW.OtOpcUa.Cluster.Tests.csproj b/tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests/ZB.MOM.WW.OtOpcUa.Cluster.Tests.csproj
index e1febe3f..a3761d95 100644
--- a/tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests/ZB.MOM.WW.OtOpcUa.Cluster.Tests.csproj
+++ b/tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests/ZB.MOM.WW.OtOpcUa.Cluster.Tests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.Cluster.Tests
- true
diff --git a/tests/Core/ZB.MOM.WW.OtOpcUa.Commons.Tests/ZB.MOM.WW.OtOpcUa.Commons.Tests.csproj b/tests/Core/ZB.MOM.WW.OtOpcUa.Commons.Tests/ZB.MOM.WW.OtOpcUa.Commons.Tests.csproj
index f42dd463..27f4ec30 100644
--- a/tests/Core/ZB.MOM.WW.OtOpcUa.Commons.Tests/ZB.MOM.WW.OtOpcUa.Commons.Tests.csproj
+++ b/tests/Core/ZB.MOM.WW.OtOpcUa.Commons.Tests/ZB.MOM.WW.OtOpcUa.Commons.Tests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.Commons.Tests
- true
diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/NativePcccBridgeStatusHealthTests.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/NativePcccBridgeStatusHealthTests.cs
index ad39c4f9..84f14aa9 100644
--- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/NativePcccBridgeStatusHealthTests.cs
+++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests/NativePcccBridgeStatusHealthTests.cs
@@ -45,20 +45,17 @@ public sealed class NativePcccBridgeStatusHealthTests
}
///
- /// InitializeAsync stamps LastSuccessfulRead with DateTime.UtcNow and the read stamps its own
- /// UtcNow microseconds later; on a coarse/identical clock reading the two are equal, so an "advanced"
- /// assertion (ShouldNotBe(before)) failed ~70% of runs (lmxopcua#767). Spin until the clock has strictly
- /// passed the init stamp so any later stamp is provably newer. The assertion itself is unchanged.
+ /// A manual clock the driver stamps health from (lmxopcua#768). Init stamps ; each test
+ /// moves it to before reading, so an "advanced" LastSuccessfulRead is provably
+ /// the read's stamp (it used to be DateTime.UtcNow twice microseconds apart, equal ~70% of runs on a
+ /// coarse clock, lmxopcua#767).
///
- private static void WaitUntilClockPast(DateTime? stamp)
- {
- if (stamp is null) return;
- var spin = new SpinWait();
- while (DateTime.UtcNow <= stamp.Value) spin.SpinOnce();
- }
+ private static readonly DateTime InitTime = new(2026, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+
+ private static readonly DateTime ReadTime = InitTime.AddSeconds(1);
#pragma warning disable OTOPCUA0001 // the driver is called directly to pin its OWN classification (no resilience wrap)
- private static async Task DriverAsync(FakeEipServer server)
+ private static async Task DriverAsync(FakeEipServer server, Func clock)
{
var host = $"ab://127.0.0.1:{server.Port}/1,0";
var driver = new AbLegacyDriver(new AbLegacyDriverOptions
@@ -67,7 +64,10 @@ public sealed class NativePcccBridgeStatusHealthTests
RawTags = AbLegacyRawTags.Entries([new AbLegacyTagDefinition("T", host, "N7:0", AbLegacyDataType.Int)]),
Timeout = TimeSpan.FromSeconds(5),
Probe = new AbLegacyProbeOptions { Enabled = false },
- }, "drv-pccc-bridge", new NativeAbLegacyTagFactory(new DeviceSessionPool()));
+ }, "drv-pccc-bridge", new NativeAbLegacyTagFactory(new DeviceSessionPool()))
+ {
+ Clock = clock,
+ };
await driver.InitializeAsync("{}", TestContext.Current.CancellationToken);
return driver;
}
@@ -78,8 +78,11 @@ public sealed class NativePcccBridgeStatusHealthTests
{
var ct = TestContext.Current.CancellationToken;
await using var server = StsServer(0x30);
- var driver = await DriverAsync(server);
+ var now = InitTime;
+ var driver = await DriverAsync(server, () => now);
var before = driver.GetHealth().LastSuccessfulRead;
+ before.ShouldBe(InitTime);
+ now = ReadTime;
var result = (await driver.ReadAsync(["T"], ct)).Single();
@@ -97,17 +100,18 @@ public sealed class NativePcccBridgeStatusHealthTests
{
var ct = TestContext.Current.CancellationToken;
await using var server = StsServer(0x60);
- var driver = await DriverAsync(server);
+ var now = InitTime;
+ var driver = await DriverAsync(server, () => now);
var before = driver.GetHealth().LastSuccessfulRead;
- WaitUntilClockPast(before);
+ before.ShouldBe(InitTime);
+ now = ReadTime;
var result = (await driver.ReadAsync(["T"], ct)).Single();
result.StatusCode.ShouldBe(AbOpcUaStatusMap.BadNotWritable);
var health = driver.GetHealth();
health.State.ShouldBe(DriverState.Healthy);
- health.LastSuccessfulRead.ShouldNotBeNull();
- health.LastSuccessfulRead.ShouldNotBe(before);
+ health.LastSuccessfulRead.ShouldBe(ReadTime);
await driver.ShutdownAsync(ct);
server.HandlerErrors.ShouldBeEmpty();
}
@@ -128,17 +132,18 @@ public sealed class NativePcccBridgeStatusHealthTests
{
var ct = TestContext.Current.CancellationToken;
await using var server = general == 0 ? StsServer(0x10) : CipEnvelopeServer(general);
- var driver = await DriverAsync(server);
+ var now = InitTime;
+ var driver = await DriverAsync(server, () => now);
var before = driver.GetHealth().LastSuccessfulRead;
- WaitUntilClockPast(before);
+ before.ShouldBe(InitTime);
+ now = ReadTime;
var result = (await driver.ReadAsync(["T"], ct)).Single();
result.StatusCode.ShouldBe(AbLegacyStatusMapper.BadNotSupported);
var health = driver.GetHealth();
health.State.ShouldBe(DriverState.Healthy);
- health.LastSuccessfulRead.ShouldNotBeNull();
- health.LastSuccessfulRead.ShouldNotBe(before);
+ health.LastSuccessfulRead.ShouldBe(ReadTime);
await driver.ShutdownAsync(ct);
server.HandlerErrors.ShouldBeEmpty();
}
diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.IntegrationTests/SparkplugSimulator/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.SparkplugSimulator.csproj b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.IntegrationTests/SparkplugSimulator/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.SparkplugSimulator.csproj
index fec0ea4e..79af14a0 100644
--- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.IntegrationTests/SparkplugSimulator/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.SparkplugSimulator.csproj
+++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.IntegrationTests/SparkplugSimulator/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.SparkplugSimulator.csproj
@@ -27,7 +27,6 @@
enable
enable
latest
- true
true
$(NoWarn);CS1591
false
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj
index 69af045a..438e49fa 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.AdminUI.Tests
- true
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests.csproj b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests.csproj
index 3b55cf6c..1e6c1d35 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests.csproj
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.ControlPlane.Tests
- true
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj
index 64a02c31..3d330106 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.Host.IntegrationTests
- true
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj
index b4d6f70e..4d254b39 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.Host.Tests
- true
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj b/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj
index 1a47a002..ba01033e 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj
@@ -4,7 +4,6 @@
false
true
ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests
- true