I don't get the impression that test_ensure_master_returns_oldest_nodegroup is 
quite enough to cover the "return the oldest one" functionality.  Whether 
ensure_master does the right thing doesn't really become obvious until you test 
with two nodegroups present, with different timestamps.

It takes a bit of tweaking to get different timestamps with certainty, because 
the database transaction clock doesn't advance during the test (and even if it 
did, because things may happen within the clock's granularity).  What I usually 
do when faced with this problem is create two objects as normal, but subtract a 
fixed timedelta from the first one's timestamp.
-- 
https://code.launchpad.net/~rvb/maas/ensure-master-takes-first/+merge/126498
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~rvb/maas/ensure-master-takes-first into lp:maas.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to