[infinispan-dev] A tip: Using a random word generator to generate uncommon test data

Manik Surtani manik at jboss.org
Wed Sep 23 13:32:17 EDT 2009


On 11 Sep 2009, at 15:44, Galder Zamarreno wrote:

>
>
> On 09/11/2009 02:23 PM, Mircea Markus wrote:
>> Another thing that helps is using the thread name. It's true that
>> there are some threads created within jgroups, and these won't match
>> but generally it helps.
>> Before starting a test, a log message is being output - this contains
>> the name of the test that is to be executed. Same after the test is
>> finished. Logs look like:
>> "Starting test..."
>> and
>> "Test Xyz failed"/"Test Xyz skipped"/"Test Xyz succeeded"

Yeah this is what I do as well.

>
> True, those tips help as well. The easier is to determine the log
> associated with a failing test, the easier debugging will be.
>
> I've also been thinking of a way to improve logging based on the
> Hibernate 2nd level cache work I did. It'd be interesting that any
> instance of a class that is specific to a cache instanc, i.e.  
> "galder",
> had the cache name appended.
>
> In environments where there're several cache instances deployed, i.e.
> AS, this would help greatly. Example:
>
> Instead of:
> 2009-09-11 16:41:05,635 591   TRACE
> [org.infinispan.interceptors.InvocationContextInterceptor] (main:)
> Invoked with command PutKeyValueCommand{key=key, value=value,
> putIfAbsent=false, lifespanMillis=-1, maxIdleTimeMillis=-1} and
> InvocationContext [NonTxInvocationContext{flags=null}]
> ...
> 2009-09-11 16:41:05,635 591   TRACE
> [org.infinispan.interceptors.CallInterceptor] (main:) Executing  
> command:
> PutKeyValueCommand{key=key, value=value, putIfAbsent=false,
> lifespanMillis=-1, maxIdleTimeMillis=-1}.
>
> Something like:
> 2009-09-11 16:41:05,635 591   TRACE
> [org.infinispan.interceptors.InvocationContextInterceptor.galder]
> (main:) Invoked with command PutKeyValueCommand{key=key, value=value,
> putIfAbsent=false, lifespanMillis=-1, maxIdleTimeMillis=-1} and
> InvocationContext [NonTxInvocationContext{flags=null}]
> ...
> 2009-09-11 16:41:05,635 591   TRACE
> [org.infinispan.interceptors.CallInterceptor.galder] (main:) Executing
> command: PutKeyValueCommand{key=key, value=value, putIfAbsent=false,
> lifespanMillis=-1, maxIdleTimeMillis=-1}.
>
> Remember that by default, in Hibernate we create a cache instance per
> entity, so imagine the number of diff caches you might have to deal  
> with
> in an app server env.

Hmm, this is an interesting approach.

>
>>
>> On Sep 11, 2009, at 1:13 PM, Galder Zamarreno wrote:
>>
>>> p.s. I'm currently using
>>> http://watchout4snakes.com/creativitytools/RandomWord/RandomWordPlus.aspx
>>>  as
>>> random word generator.
>>>
>>> On 09/11/2009 12:12 PM, Galder Zamarreno wrote:
>>>> Guys,
>>>>
>>>> Looking at the Infinispan tests, I've seen plenty same keys/values
>>>> repeated in loads of tests, i.e. k1, k2, v1, v2....etc, so  
>>>> sometimes,
>>>> when you're debugging a specific tests, particularly when running  
>>>> the
>>>> whole testsuite, it's hard to pint point the data related to your
>>>> test
>>>> since same key/values are used by several tests.
>>>>
>>>> So, to try to help with finding the data related to my tests, I'm
>>>> trying
>>>> to use random word generator to generate uncommon or obscure words
>>>> that
>>>> I can use in the tests. Doing this allows me to quickly find my
>>>> data in
>>>> the logs, i.e. "key-isoprene"
>>>>
>>>> I don't know whether other people are interesting in using a  
>>>> similar
>>>> method but at least for me, it helps.
>>>>
>>>> Cheers,
>>>
>>> --
>>> Galder Zamarreño
>>> Sr. Software Engineer
>>> Infinispan, JBoss Cache
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> infinispan-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> -- 
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org








More information about the infinispan-dev mailing list