jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: is jmeter caching the hosts file ? the new hosts values are not picked during runtime
Date Mon, 12 Feb 2007 23:42:44 GMT
Host name resolution is done either by Java or more likely Windows.

I don't know if you can change how long the names are cached for.


On 12/02/07, jmeter list <jmeterlist@yahoo.com> wrote:
> Hi,
>  I'm having a problems with updating a hosts file during my test run and making an http
request.
>
>  Here is and example of the scenario
>
>  1)
>  update hosts file to (ip1 is a working ip which should resolve correctly):
>  ip1 test_domain
>
>  2) make an http request with test_domain, which resolves to the ip1 and returns expected
results string
>
>  3)
>  update hosts file to (ip2 is a non-working ip which should not resolve or return anything):
>  ip2 test_domain
>
>  4) make an http request with test_domain, this request also returns the same results
as step 2 which leads me to believe that somewhere jmeter caches the hosts during startup?
>
>  At all phases of the test the hosts file is guaranteed to have only one entry
>  "ip1    test_domain" or  "ip2    test_domain"
>
>  I use beanshell to write a new entry to my hosts file:
>
>  ====================================
>  String pattern =  "123.123.123    test_domain";
>
> String fileName = "C:\WINDOWS\\system32\\drivers\\etc\\hosts";
>
> try {
>        BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
>        out.write(pattern);
>        out.close();
>    } catch (Exception e) {
>        System.out.println(e);
> }
>
>  ====================================
>
>  The http request is made with an  http request sampler which is a get type request (keep
alive and redirect boxes are not checked)
>
>  I also tried using httpclient sampler with no success.
>
>  What can i do to have jmeter pickup the hosts change during runtime and only during
startup?
>
>  Thanks,
> Ken
>
>
> ---------------------------------
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo! Games.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message