Information
|
9.
How to solve test case locking problems
Question
Occasionally when running
tcc
we get the following type of
messages:
110|59 /tset/tc1/tc1 12:25:52|Build Start, scenario ref 24-0
50||(lock.c, 120): can't acquire exclusive lock \
c:/Tet3.2/suite/tset/tc1/tet_lock on system 000, \
server reply code = ER_NOENT
130|59 -3 12:25:52|Build End, scenario ref 24-0
10|60 /tset/tc1/tc1 12:25:52|TC Start, scenario ref 24-0
50||(lock.c, 120): can't acquire exclusive lock \
c:/Tet3.2/suite/tset/tc1/tet_lock on system 000, \
server reply code = ER_NOENT
80|60 -3 12:25:53|TC End, scenario ref 24-0
The lock appears to be a file in the test directory.
Any ideas as to what might be causing this?
Answer
When
tcc
processes a test case, it uses a locking scheme to prevent
multiple
tcc
processing threads from interfering with each other.
The error messages that you describe are generated when
tcc
can't create a lock for some reason.
Usually this is because either:
-
the directory in which the lock is to be created doesn't
exist or is not writable; or:
-
the lock already exists when
tcc
attempts to create it.
Clearly, the first case is evidence of a test suite setup problem.
The directory containing a test case that is mentioned in a scenario
must exist and be writable by
tcc
(in TETware-Lite) or
tccd
(in Distributed TETware).
Here are some common reasons for the second case:
-
The test suite is being processed by more than one instance
of
tcc.
-
The scenario uses the
:parallel:
directive and the test suite has not been structured in a way that
permits parallel processing.
-
A previous
tcc
run has crashed or has been killed, leaving locks in place.
The solutions to these problems are:
-
Make sure that the test suite is only being processed by one
instance of
tcc.
If you are using Distributed TETware, remember to check that
your system is not being used as a remote target of
tcc
running on another system.
-
If you are using the
:parallel:
directive, you must arrange
for each test case to have its own directory.
If you use
:parallel, count:
to execute more than one copy of each test case, you must set
TET_EXEC_IN_PLACE=false
in the execute mode configuration.
-
Make sure that there is no other instance of
tcc
processing the test case, then remove the lock by hand.
See also
-
"Build mode processing'', "Execute mode processing'',
"Clean mode processing'' and "Locking'' in Chapter 3 of the TETware
Programmers Guide.
|