roryLIT
12 years agoContributor
Only letting an external file be accessed by one testcase
I have a testsuite of 60 testcases and an external text file with a list of values. I want to run the testcases concurrently. Each testcase will access this file and take a value from the file to use in the test. The issue I'm having is more than 1 test is taking the same value because they are accessing the file at the same time (the same value can't be used in more than 1 test at the same time). I need a way where the file can only be accessed by one testcase at a time. Any ideas for what I could write in Groovy for this? I would use this groovy script at the start of each testcase