05-06-2014 06:26 AM
I'm trying to write some performance tests in funkload. I would like to do some service discovery in the test setUpCycle() and then have that information passed to every thread the benchmark starts. However setting a variable in the setUpCycle() or setupBench() does not propagate to the test itself. Is there any way to do this?
class PerfTest(FunkLoadTestCase):
def setUpCycle(self):
self.service = service_discover() # this is a costly operation
def test_Get(self):
print self.service
Running fl-run-bench on this test fails with "'PerfTest' has no attribute 'service'.
05-09-2014 10:31 AM
Hi, yes this is correct, setUpBench and setUpCycle are called with a private instance of the testcase.
If you need to share data between the running threads you can put your data in a file during the setUpCycle and read the file from the setUp method.
Thanks for your feedback, I will update the docs to make this clear.
ben
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.