Supposing that we've got a web app which manages some kind of devices in some domain.
Each device can be added only once, obviously -- the limited test resources.
There are several automating testers working on this app at the same time. Two testers might add the same device, in which case one tester will get exception in his/her automation tests.
how to avoid this kind of conflicts on such limited resources?
I've thought out the following methods, none seems satisfying:
1) Add some class with static Map<String device, String isAddedAlready> which stores all devices and their states -- works only for one tester.
2) Assign each tester some proprietary devices -- makes the limited resources more limited, and what if there were more testers than available devices?
- - - - - - - - - - - -
The confilcting situation is like this : Tester A and tester B both have a test method(Java code) that add a device, modify the device's name, and then delete the device. If A and B use the same IP at the same time, which is inevitable as the number of tests and testers grows, one test would fail.
Since neither A nor B have the idea of which IP the other tester would use in his/her test method, it's sensible to set up a querying-and-locking-and-freeing service(a register center, a resource center?).
The app stores data in a database(oracle, mysql or postgresql).
Besides, it's possible that we run several apps at the same time, which makes the situation more complicated.