From 950d5d27605572a582059447dba219cb7df99a13 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Fri, 14 Nov 2008 11:49:12 +0100 Subject: [PATCH] Bug#40715 mtr fails when running the same test case in parallel threads mysql-test/lib/My/Test.pm: Use a more unique key to identify which test has been serialized --- mysql-test/lib/My/Test.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm index 890ae76b282..68b100f91af 100644 --- a/mysql-test/lib/My/Test.pm +++ b/mysql-test/lib/My/Test.pm @@ -26,9 +26,7 @@ sub new { # sub key { my ($self)= @_; - my $key= $self->{name}; - $key.= "+".$self->{combination} if $self->{combination}; - return $key; + return $self->{key}; } @@ -57,6 +55,9 @@ sub is_failed { sub write_test { my ($test, $sock, $header)= @_; + # Give the test a unique key before serializing it + $test->{key}= "$test" unless defined $test->{key}; + print $sock $header, "\n"; while ((my ($key, $value)) = each(%$test)) { print $sock $key, "= ";