View Issue Details

IDProjectCategoryView StatusLast Update
0008398CTT UA Scripts5 - General Problempublic2025-02-04 10:05
ReporterAdrian Scholl Assigned ToYannik Klaass  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOS10OS Version21H2
Fixed in Version1.03.503 
Summary0008398: Subscription / Subscription Basic / Err-029.js does not close created subscriptions properly
Description

Subscription / Subscription Basic / Err-029.js does not close created subscriptions properly

This test case creates up to 1000 subscriptions on a single session. These subscriptions are created one after another. When deleting all subscriptions, the CTT sends only one single DeleteSubscriptions service containing all IDs. This leaves many active subscriptions on the session if the supports less than <createdSubscriptions> per service call.

As a result, following test cases do not work properly because sent PublishRequests are used to send Responses for the subscriptions of test case Err-029.js. Most subscritpions will be in late state.

Steps To Reproduce

Run Err-029. Track traffic using Wireshark. Check if the MaxSubscriptionsPerCall are taken into account when deleting the subscriptions, or that the created subscriptions are deleted one by one.

Additional Information

Check the attached file as a proposal for a ony by one deletion.

TagsNo tags attached.
Attached Files
Err-029.js (2,209 bytes)   
/*  Test 5.10.6-Err-011 prepared by Nathan Pocock; compliance@opcfoundation.org
    Description:
        Script creates more Subscriptions than a server can handle.
        Expects to receive Bad_TooManyOperations when creating that subscription that is beyond the server's ability. */

function deleteSubsription5106err011() {
    // does the server impose a restriction or not? if not then lets arbitrarily try 1000 subscriptions
    var maxSubscriptions = ( gServerCapabilities.MaxSupportedSubscriptions === 0 ? 1000 : gServerCapabilities.MaxSupportedSubscriptions + 10 );

    // first, create more subscriptions than the server claims to support
    var subscriptions = [];

    var serviceResult = new ExpectedAndAcceptedResults( [ StatusCode.Good, StatusCode.BadTooManySubscriptions, StatusCode.BadTooManyOperations ] );
    // the test: invoke the createSubscriptions call
    for( var s=0; s<maxSubscriptions; s++ ) { 
        var sub = new Subscription();
        if( CreateSubscriptionHelper.Execute( { Subscription: sub, ServiceResult: serviceResult } ) ) {
            // did it fail? 
            if( CreateSubscriptionHelper.Response.ResponseHeader.ServiceResult.isBad() ) {
                addLog( "CreateSubscription() failed gracefully." );
                break;
            }
            else subscriptions.push( sub );
        }
    }

    if( !subscriptions.length > gServerCapabilities.MaxSupportedSubscriptions ) addLog( "Server supports more subscriptions than it currently advertises, or does not impose a limit on the number of subscriptions." );
    else if( subscriptions.length < gServerCapabilities.MaxSupportedSubscriptions ) addError( "Server does not support as many subscriptions as configured. Expected: " + gServerCapabilities.MaxSupportedSubscriptions + "; Actual: " + subscriptions.length );

    // lastly, try to delete the subscriptions, and allow for this call to fail also 
    for( var s=0; s<subscriptions.length; s++ ) { 
        DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscriptions[s], ServiceResult: serviceResult } );
    }
    
    

    PublishHelper.Clear();
    return( true );
}

Test.Execute( { Procedure: deleteSubsription5106err011 } );
Err-029.js (2,209 bytes)   
Files Affected

/library/ServiceBased/SubscriptionServiceSet/DeleteSubscriptions.js

Relationships

related to 0010135 assignedSebastian Allmendinger Subscription Basic Err-029: Subscriptions are still not closed 

Activities

Paul Hunkar

2022-11-03 15:19

administrator   ~0018093

Last edited: 2022-11-03 15:24

Check if there is an operation limit (or CTT limit) - don't think the CTT should have a separate limit. The server might have limit for max array size or message size [these server limits have to also be honored as part of service calls]

Yannik Klaass

2023-07-03 09:33

developer   ~0019687

Modified the DeleteSubscriptions Service to split up calls if the length of SubscriptionIds is exceeding the ServerCapabilities.MaxArrayLength

Paul Hunkar

2023-07-21 16:39

administrator   ~0019710

reviewed in call, agreed to changes and close issue

Issue History

Date Modified Username Field Change
2022-10-07 13:48 Adrian Scholl New Issue
2022-10-07 13:48 Adrian Scholl File Added: Err-029.js
2022-11-03 15:18 Paul Hunkar Assigned To => Alexander Allmendinger
2022-11-03 15:18 Paul Hunkar Status new => assigned
2022-11-03 15:19 Paul Hunkar Note Added: 0018093
2022-11-03 15:24 Paul Hunkar Note Edited: 0018093
2023-07-03 09:33 Yannik Klaass Assigned To Alexander Allmendinger => Yannik Klaass
2023-07-03 09:33 Yannik Klaass Status assigned => resolved
2023-07-03 09:33 Yannik Klaass Resolution open => fixed
2023-07-03 09:33 Yannik Klaass Note Added: 0019687
2023-07-21 10:13 Yannik Klaass Status resolved => feedback
2023-07-21 10:13 Yannik Klaass Resolution fixed => reopened
2023-07-21 10:14 Yannik Klaass Files Affected => /library/ServiceBased/SubscriptionServiceSet/DeleteSubscriptions.js
2023-07-21 10:14 Yannik Klaass Status feedback => resolved
2023-07-21 10:14 Yannik Klaass Resolution reopened => fixed
2023-07-21 16:38 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Scripts
2023-07-21 16:39 Paul Hunkar Status resolved => closed
2023-07-21 16:39 Paul Hunkar Fixed in Version => 1.03.503
2023-07-21 16:39 Paul Hunkar Note Added: 0019710
2025-02-04 10:05 Sebastian Allmendinger Relationship added related to 0010135