OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.97k stars 950 forks source link

Implement a system test for DurableSubscriptions #2839

Open Archie-Miller opened 2 weeks ago

Archie-Miller commented 2 weeks ago

Uses the same parameters to validate non Durable vs Durable

Proposed changes

Implement a system unit test to test the functionality of Durable Subscriptions in the Reference Server

Tests add 14 seconds to the Opc.Ua.Client.Tests

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply. You can also fill these out after creating the PR.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 56.05%. Comparing base (d2b4aa2) to head (c32a7fc).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop/durable #2839 +/- ## =================================================== + Coverage 55.97% 56.05% +0.07% =================================================== Files 353 353 Lines 66248 66248 Branches 13582 13582 =================================================== + Hits 37085 37138 +53 + Misses 25192 25141 -51 + Partials 3971 3969 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

romanett commented 2 weeks ago

Test seems to work good on my machine, however the Test fails on MacOS & Linux:

Linux:

Failed Validate Transfer [9 s]
  Error Message:
     Assert.That(arg1, Is.LessThan(arg2))
  Expected: less than 1500.0d
  But was:  1527.681d

  Stack Trace:
     at NUnit.Framework.Legacy.ClassicAssert.Less(Double arg1, Double arg2)
   at Opc.Ua.Client.Tests.DurableSubscriptionTest.TestSessionTransfer(Boolean setSubscriptionDurable) in /_/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs:line 461

MacOS:

Failed Validate Transfer [66 ms]
  Error Message:
     Assert.That(anObject, Is.Not.Null)
  Expected: not null
  But was:  null

  Stack Trace:
     at NUnit.Framework.Legacy.ClassicAssert.IsNotNull(Object anObject)
   at Opc.Ua.Client.Tests.DurableSubscriptionTest.GetDesiredNodeIds(UInt32 subscriptionId) in /_/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs:line 601
   at Opc.Ua.Client.Tests.DurableSubscriptionTest.TestSessionTransfer(Boolean setSubscriptionDurable) in /_/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs:line 352