#6140 Tests: create method leaves tracker inconsistent when the operation fails
Opened 8 years ago by benlipton. Modified 8 years ago

https://git.fedorahosted.org/cgit/freeipa.git/tree/ipatests/test_xmlrpc/test_certprofile_plugin.py?id=dc62dd8c908b3c8a8c166006d2d4e71dde99883e#n72 is an example of a tracker for an object whose creation is expected to fail with an exception. If we call make_fixture() on this tracker, the tests will fail with a NotFound error. This is because the finalizer added by make_fixture() checks self.exists:

existed = self.exists
try:
    del_command()
except errors.NotFound:
    if existed:
        raise

And create() sets self.exists by calling track_create() before seeing whether the actual create command succeeds.

It would be nice to be able to call make_fixture on all fixtures, even broken ones. Otherwise, if a call that is supposed to fail actually creates an LDAP object, it won't get removed and will mess up the next test run.


Metadata Update from @benlipton:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.4.4

8 years ago

Metadata Update from @mbasti:
- Issue close_status updated to: None
- Issue set to the milestone: FreeIPA 4.4.5 (was: FreeIPA 4.4.4)

8 years ago

Log in to comment on this ticket.

Metadata