title: Possible JMeter bug when using JDBC Connection over SSH?
body: <p>I need to perform a load test against a pgbouncer. All the clients perform an SSH Tunnel before enstablishing a database connection to the database (through the pgbouncer). It's something like this:</p>
  <pre><code>sshpass -p 'MY_PSW' ssh -o StrictHostKeyChecking=no -N -L LOCAL_PORT:127.0.0.1:63666 PGBOUNCER_USER@PGBOUNCER_ADDRESS -p PORT &gt;/dev/null 2&gt;&amp;1 &amp;
  </code></pre>
  <p>My Jmeter project has three thread Groups at the moment:</p>
  <ol>
  <li><p><strong>SetUp Thread Group</strong>: In which I make a connection to a different database to select a random username and schema</p>
  </li>
  <li><p><strong>Query Thread Group</strong>: In which I perform the JDBC connection using the previous user (which became a property using <code>props.put(&quot;schema&quot;, vars.get(&quot;schema_1&quot;));</code> into the BeanShell Assertion) and the queries</p>
  </li>
  <li><p><strong>TearDown Thread Group</strong>: In which I close the ssh Tunnel.</p>
  </li>
  </ol>
  <p>Now every first time I run the test from the GUI, the data select (JDBC request) into the Query Thread Group gives me an error:</p>
  <pre><code>Cannot create PoolableConnectionFactory (FATAL: &quot;trust&quot; authentication failed)
  </code></pre>
  <p>After that, if I run the test again, everything works. I checked the content of the variables and properties with a Debug sampler and everything is correct.</p>
  <p>The main problem starts when I run the test without the GUI. It always fails because of that error.</p>
  <p>I actually don't like the fact that I have to enstablish the SSH tunnel running the command with an OS Process Sampler, but I can't find any better solution. The SSH tunnel is a part of the test, I don't need that for the master/slave configuration of JMeter.</p>
  <p>I would appreciate a lot for a solution or a suggestion to make this work. Thanks.</p>