PS: I created a bug report for this issue, you can Cc: yourself, if you want: https://code.google.com/p/ganeti/issues/detail?id=721 And thanks for reporting it!
On Tue, Feb 18, 2014 at 3:43 PM, Petr Pudlák <[email protected]> wrote: > Hi Illias, > > it seems that there is really a problem and that the test works only > because the primary node is the first in alphabetical order. I'll look into > it and let you know. > > Best regards, > Petr > > > On Fri, Feb 14, 2014 at 4:17 PM, Ilias Tsitsimpis <[email protected]>wrote: > >> Hello Team, >> >> Method '_GenericCheck' of 'TestInstance' test class inside >> 'test/py/ganeti.objects_unittest.py' has the following assertion: >> >> self.assertEqual(inst.all_nodes[0], inst.primary_node, >> msg="Primary node not first node in list") >> >> i.e. it tests that the first node in 'all_nodes' is always the primary >> node. >> >> Inspecting the code shows that this is not the case. >> '_ComputeAllNodes' uses sets which is an unordered type. Thus we can >> not assume that primary node will always be the first node. >> >> I wonder if only the test here is buggy (and should be fixed) or if >> the assumption that primary node is the first node has been made >> anywhere else in the code. >> >> What do you think? >> Ilias >> >> -- >> Ilias Tsitsimpis >> OpenPGP public key ID: >> pub 4096R/25F3E3EE 2012-11-02 Ilias Tsitsimpis <[email protected]> >> Key fingerprint = 1986 21F5 7024 9B25 F4E2 4EF7 6FB8 90BA 25F3 E3EE >> > >
