<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic In funkload, is it possible to do set up variables in setUpCycle() and have it accessible in the test itself? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/in-funkload-is-it-possible-to-do-set-up-variables-in-setupcycle/m-p/317427#M4428</link>
    <description>&lt;P&gt;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?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;class PerfTest(FunkLoadTestCase):
  def setUpCycle(self):
    self.service = service_discover() # this is a costly operation

  def test_Get(self):
    print self.service
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Running fl-run-bench on this test fails with "'PerfTest' has no attribute 'service'.&lt;/P&gt;</description>
    <pubDate>Tue, 06 May 2014 10:26:26 GMT</pubDate>
    <dc:creator>ians_</dc:creator>
    <dc:date>2014-05-06T10:26:26Z</dc:date>
    <item>
      <title>In funkload, is it possible to do set up variables in setUpCycle() and have it accessible in the test itself?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-funkload-is-it-possible-to-do-set-up-variables-in-setupcycle/m-p/317427#M4428</link>
      <description>&lt;P&gt;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?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;class PerfTest(FunkLoadTestCase):
  def setUpCycle(self):
    self.service = service_discover() # this is a costly operation

  def test_Get(self):
    print self.service
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Running fl-run-bench on this test fails with "'PerfTest' has no attribute 'service'.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 10:26:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-funkload-is-it-possible-to-do-set-up-variables-in-setupcycle/m-p/317427#M4428</guid>
      <dc:creator>ians_</dc:creator>
      <dc:date>2014-05-06T10:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: In funkload, is it possible to do set up variables in setUpCycle() and have it accessible in the test itself?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-funkload-is-it-possible-to-do-set-up-variables-in-setupcycle/m-p/317428#M4429</link>
      <description>&lt;P&gt;Hi,
yes this is correct,
setUpBench and setUpCycle are called with a private instance of the testcase.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Thanks for your feedback, I will update the docs to make this clear.&lt;/P&gt;
&lt;P&gt;ben&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 14:31:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-funkload-is-it-possible-to-do-set-up-variables-in-setupcycle/m-p/317428#M4429</guid>
      <dc:creator>ben_</dc:creator>
      <dc:date>2014-05-09T14:31:04Z</dc:date>
    </item>
  </channel>
</rss>

