NetworkSuite.LeaveCriticalSection Method

Applies to TestComplete 15.45, last modified on December 01, 2022
The Network Suite functionality is deprecated. We don’t recommend using it for distributed testing. Consider using a CI/CD system for managing distributed tests. See Migrating Distributed Tests to CI/CD Systems for details. In case you need to run web tests on multiple environments in parallel, you can also try using your project’s Execution Plan.

Description

The LeaveCriticalSection makes the current project leave a critical section making it possible for other projects to access this critical section.

Declaration

NetworkSuite.LeaveCriticalSection(Name)

Name [in]    Required    String    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Name

Specifies the name of the needed critical section (case-insensitive).

Result Value

None.

Remarks

To request access to a critical section, use the NetworkSuite.EnterCriticalSection method.

Example

The following script halts the network suite's execution if the script doesn't get access to the CS1 critical section within the specified period.

JavaScript, JScript

if (NetworkSuite.EnterCriticalSection("CS1", 600000))
{
  ...
  NetworkSuite.LeaveCriticalSection("CS1");
}
else
  NetworkSuite.Stop();

Python

if NetworkSuite.EnterCriticalSection("CS1", 600000):
  # ...
  NetworkSuite.LeaveCriticalSection("CS1")
else:
  NetworkSuite.Stop()

VBScript

If NetworkSuite.EnterCriticalSection("CS1", 600000) = True Then
  ...
  NetworkSuite.LeaveCriticalSection "CS1"
Else
  NetworkSuite.Stop
End If

DelphiScript

if NetworkSuite.EnterCriticalSection('CS1', 600000) then
begin
  ...
  NetworkSuite.LeaveCriticalSection('CS1');
end
else
  NetworkSuite.Stop;

C++Script, C#Script

if (NetworkSuite["EnterCriticalSection"]("CS1", 600000))
{
  ...
  NetworkSuite["LeaveCriticalSection"]("CS1");
}
else
  NetworkSuite["Stop"]();

See Also

Distributed Testing
NetworkSuite.EnterCriticalSection
Critical Sections

Highlight search results