onitake edited a comment on issue #3546: [FIX] Rethrow takeVMSnapshot() exception URL: https://github.com/apache/cloudstack/pull/3546#issuecomment-519829463 The problem here is that this fairly difficult, as I don't have a reliable way to trigger throwing an exception, in a real life scenario. As I'm also new to the CloudStack code base, I don't know if there is a good way to test the behaviour in a unit test. A test scenario should (roughly) look like this: - prepare a test VM - prime takeVMSnapshot so it throws an exception - create a VM snapshot - verify that: no NPE occurs, the error is propagated back to the user and/or log, no snapshot was created, no invalid database entry for the snapshot remains (i.e. no DB entry at all, or a DB entry in error state) Conversely, a positive test should also exist, that does the following: - prepare a test VM - create a VM snapshot - verify that: no NPE occurs, no error is generated, a snapshot was created, a valid DB entry for the snapshot exists
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
