Alcatel-Lucent__10
15 years agoOccasional Contributor
Can a property be locked ?
I have created a testcase, which will be run as loadtest.
When starting the loadtest, the setup script will define some properties like e.g. context['NbrFBNSuccess']=0
During testcase execution, the property is updated by the different threads, using the following code :
NbrFBNSucces = context.LoadTestContext.getProperty("NbrFBNSucces").toInteger()
NbrFBNSucces++
context.LoadTestContext.setProperty("NbrFBNSucces",NbrFBNSucces.toString()
Now I have noticed that it sometimes happen that 2 threads are working on the same property at the same time, resulting in incorrect counter value.
Is there a way, that a thread can lock a property for a short time ?
When starting the loadtest, the setup script will define some properties like e.g. context['NbrFBNSuccess']=0
During testcase execution, the property is updated by the different threads, using the following code :
NbrFBNSucces = context.LoadTestContext.getProperty("NbrFBNSucces").toInteger()
NbrFBNSucces++
context.LoadTestContext.setProperty("NbrFBNSucces",NbrFBNSucces.toString()
Now I have noticed that it sometimes happen that 2 threads are working on the same property at the same time, resulting in incorrect counter value.
Is there a way, that a thread can lock a property for a short time ?