[Twg] Separated test execution

Alexey Lyashkov alexey_lyashkov at xyratex.com
Tue May 15 18:53:34 UTC 2012


On May 15, 2012, at 21:41, Andreas Dilger wrote:
> 
> 
>> Very similar situation is for recovery-small 1, 2, 3 and 4, 5.
>> 
>> test_1() {
>> drop_request "mcreate $DIR/f1" || return 1
>> drop_reint_reply "mcreate $DIR/f2" || return 2
>> }
>> run_test 1 "mcreate: drop req, drop rep"
>> 
>> test_2() {
>> drop_request "tchmod 111 $DIR/f2"  || return 1
>> drop_reint_reply "tchmod 666 $DIR/f2"  || return 2
>> }
>> run_test 2 "chmod: drop req, drop rep"
>> 
>> test_3() {
>> drop_request "statone $DIR/f2" || return 1
>> drop_reply "statone $DIR/f2"   || return 2
>> }
>> run_test 3 "stat: drop req, drop rep"
>> 
>> These three tests are actually steps of a single test scenario, because they work with the results of previous ones.
>> 
>> or join them into one and remove test_2 and test_3.
>> 
>> test_1() {
>>   drop_request "mcreate $DIR/f1"  || return 1
>>   drop_reint_reply "mcreate $DIR/f2"    || return 2
>>   drop_request "tchmod 111 $DIR/f2"  || return 3
>>   drop_reint_reply "tchmod 666 $DIR/f2"    || return 4
>>   drop_request "statone $DIR/f2" || return 5
>>   drop_reply "statone $DIR/f2"   || return 6
>> }
>> run_test 1 "mcreate, chmod,stat: drop req, drop,req"
> 
> As someone else commented, I really dislike the use of error codes to signal failures.  The "1", "2", ... return codes have no real meaning, and seeing a result like "recovery small test_1 failed with 3" is useless compared to "recovery_small test_1 failed when resending chmod request".
> 
> If you are doing any significant subtest restructuring, please use "error" instead of "return".
Andreas,

using a string is hard to parse and find a place to fail a test, but if we use a return codes we a easy map a error to place where it hit.
I like to combine a two approaches.
error should be set a return code and print a message.
message usefull to a user, but error code user full for automatic execution.


--------------------------------------------
Alexey Lyashkov
alexey_lyashkov at xyratex.com





More information about the Twg mailing list