View Issue Details

IDProjectCategoryView StatusLast Update
0003462Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2019-01-28 13:18
ReporterMartin Lang Assigned ToAlexander Allmendinger  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.03 
Target Version1.03Fixed in Version1.03.340.349 
Summary0003462: Subscription Services/Basic/052.js - does not delete subscription correct, if service CreateMonitoredItems fails
Description

If CreateMonitoredItems succeed, but CreateMonitoredItems fails the script miss the right number of DeleteSubscription calls.
After script exit one Subscription still is alive.

Steps To Reproduce
  • start server which does not support CreateMonitoredItem service
  • run script
Additional Information

current implementation:
[...]
// step 1 - create the subscriptions and monitored items
for( sc=0; sc<subscriptions.length; sc++ ) {
if( !CreateSubscriptionHelper.Execute( { Subscription: subscriptions[sc] } ) ) return( false );
// step 2 - adding some items to subscribe to (monitor).
// 4 params are: (1) items to monitor (2) timestamps (3) subscription (4) sesssion
if( !CreateMonitoredItemsHelper.Execute( { ItemsToCreate: items[sc], TimestampsToReturn: TimestampsToReturn.Both, SubscriptionId: subscriptions[sc] } ) ) {
for( var z=0; z<sc; z++ ) {
// unregister the subscription with Publish
PublishHelper.UnregisterSubscription( subscriptions );
DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscriptions[z] } );
}
return( false );
}
}
[...]

fixed implementation:
[...]
// step 1 - create the subscriptions and monitored items
for( sc=0; sc<subscriptions.length; sc++ ) {
if( !CreateSubscriptionHelper.Execute( { Subscription: subscriptions[sc] } ) ) return( false );
// step 2 - adding some items to subscribe to (monitor).
// 4 params are: (1) items to monitor (2) timestamps (3) subscription (4) sesssion
if( !CreateMonitoredItemsHelper.Execute( { ItemsToCreate: items[sc], TimestampsToReturn: TimestampsToReturn.Both, SubscriptionId: subscriptions[sc] } ) ) {
/**/
for( var z=0; z<=sc; z++ ) { // change for-loop condition from z<sc to z<=sc
/**/
// unregister the subscription with Publish
PublishHelper.UnregisterSubscription( subscriptions );
DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscriptions[z] } );
}
return( false );
}
}
[...]

TagsNo tags attached.
Files Affected

Activities

Martin Lang

2016-07-08 12:32

reporter   ~0007095

used CTT version 1.2.336.273

Nathan Pocock

2016-10-07 15:59

viewer   ~0007194

It seems that the loop is not even necessary because the inner-code is simply deleting all subscriptions in one call.

I think the loop needs to be removed, but to keep the code inside of it.

Can you please let me if the following code resolves the issue you have found:

    if( !CreateMonitoredItemsHelper.Execute( { ItemsToCreate: items[sc], TimestampsToReturn: TimestampsToReturn.Both, SubscriptionId: subscriptions[sc] } ) ) {
        // unregister the subscriptions with Publish 
        PublishHelper.UnregisterSubscription( subscriptions );
        DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscriptions } );
        return( false );
    }

Martin Lang

2016-10-10 12:43

reporter   ~0007195

The new code seems to be good. The wireshark report is looking good. Tested with a server which was configured to support 1 monitored item and in a second run the service was "not implemented".

Alexander Allmendinger

2017-09-11 14:20

developer   ~0008434

Script has already been fixed

Paul Hunkar

2019-01-28 13:18

administrator   ~0009831

Reviewed in CMP call 2019-01-28

Issue History

Date Modified Username Field Change
2016-07-08 12:32 Martin Lang New Issue
2016-07-08 12:32 Martin Lang Note Added: 0007095
2016-10-07 15:59 Nathan Pocock Note Added: 0007194
2016-10-07 15:59 Nathan Pocock Assigned To => Nathan Pocock
2016-10-07 15:59 Nathan Pocock Status new => feedback
2016-10-10 12:43 Martin Lang Note Added: 0007195
2016-10-10 12:43 Martin Lang Status feedback => assigned
2017-08-17 15:43 Paul Hunkar Assigned To Nathan Pocock => Alexander Allmendinger
2017-09-11 14:20 Alexander Allmendinger Note Added: 0008434
2017-09-11 14:20 Alexander Allmendinger Status assigned => resolved
2017-09-11 14:20 Alexander Allmendinger Fixed in Version => 1.03.340.349
2017-09-11 14:20 Alexander Allmendinger Resolution open => fixed
2019-01-28 13:16 Paul Hunkar Category Implementation Bug => General Problem
2019-01-28 13:16 Paul Hunkar Product Version => 1.03
2019-01-28 13:16 Paul Hunkar Target Version => 1.03
2019-01-28 13:16 Paul Hunkar Category General Problem => Script Issue
2019-01-28 13:18 Paul Hunkar Status resolved => closed
2019-01-28 13:18 Paul Hunkar Note Added: 0009831
2019-01-28 14:10 Paul Hunkar Category Script Issue => 1 - Script Issue