Thursday, 2024-01-11

opendevreviewRodolfo Alonso proposed openstack/devstack master: [OVN] Add support for the Neutron OVN agent service  https://review.opendev.org/c/openstack/devstack/+/90417108:14
dansmithgmann: kopecmartin: what's the definition of a negative test for tempest?15:10
dansmithmy feeling is that it's something like "tests something that shouldn't be possible" but I'm wondering if it also includes some things like "try to break something and make sure the failure is correct"15:12
dansmithis it just the former or also the latter?15:12
kopecmartindansmith: the first one - https://opendev.org/openstack/tempest/src/branch/master/HACKING.rst#negative-tests 15:29
dansmithouch, RTFM'd :P15:29
kopecmartin"try to break" sounds very not deterministic, more of a stress test in a sense  15:30
dansmithhmm, not sure the docs there really cover my second case15:30
dansmithwe have a test that creates an image, tries to snapshot it, and then deletes the image mid-snapshot and makes sure we get a particular error15:31
dansmithI was chasing a traceback in the server side logs and saw it was in the ImagesTest (and not a negative one) so I figured it was something expected to work15:32
dansmithnot proposing a change to the location of the test or anything, just kinda rambling about whether my expectations of what goes where is in line15:33
kopecmartini'm having flashbacks about a similar case, probably long time ago we discussed something like that, or maybe a new test we wanted to write, the outcome was that stopping an operation mid-fly is not 100% reproducible and thus a test like that should not be in tempest16:07
dansmithyeah, I don't know that we have problems with this being flaky, but you're right, it's a race16:09
gmanndansmith: on negative tests, if anything not coverable at project side functional tests or it is good scenario tests then it make sense to add in tempest. but most of negative tests testing API/DB param/limits are not welcome in tempest as they can be easily covered by unit tests at project side19:18
dansmithyeah, I get that for sure (and agree)19:19
gmannyour case seems ok but as kopecmartin mentioned if it is 100% operable via API operation (delete image min-snapshot) then we cna add19:19
dansmithto be clear, it's already in the tree19:19
gmannok19:19
dansmithI was surprised to see it in a non-NegativeTest class19:19
dansmithbecause it seems like a negative test to me (and maybe not very appropriate in general)19:20
gmannohk, that might be mistake when we added it. agree that these cases should be in negative test class19:20
dansmithLike, I saw the trace it was creating in n-cpu logs, saw it was for a non-negative test class, and assumed it was something really broken19:21
dansmithbut in reality it was expected because it was a snapshot-and-delete-fast scenario in ImagesTest19:22
dansmiththere are other such errors in the log, but all for ImagesNegativeTest...19:22
gmanni see, I also get sometime confuse with those failure logs but seeing they are from negative test class help to know19:23
gmanndansmith: which test that was?19:27
dansmithgmann: https://github.com/openstack/tempest/blob/master/tempest/api/compute/images/test_images.py#L5219:27
gmanndansmith: so in this tests image should get deleted while it in saving state right?19:29
gmanni mean this seems positive test19:30
dansmithokay yeah, I'm coming at it from the other perspective of what I'm actually testing19:33
dansmithbut I see, one way to read this is "make sure we can delete an image while snapshotting" which is positive19:34
dansmithsince I'm reviewing glance changes around this, I'm thinking about it from the perspective of "make sure the snapshotting gracefully handles a deleted-in-the-middle image" which is more negative19:34
dansmithso, fair enough :)19:34
dansmithand given this is a compute test, I guess the positive reading is the right one in this case :P19:35
gmannohk, so what snapshot API suppose to return in this case?19:35
gmann400 ?19:35
dansmithno, snapshot api is async, so it has already returned, but it kicks off a long-running process in glance which we monitor19:35
dansmithbut in this case nova is just adding a location (which is the new API being tested) to glance once it's done, but the image has been deleted so that update call fails with 404 (as it should)19:36
dansmithanyway, I wasn't proposing a change to the test anyway, I was just more wondering if it was perhaps misplaced19:37
gmanni see, maybe delete image should stop that process too, notify nova19:37
dansmithbut thinking about it from nova's perspective, it's a positive test19:37
gmannyeah19:38
dansmithwell, it can't really because depending on ceph or non-ceph, nova might be doing the long running thing instead of glance19:38
dansmithanyway, I'm good, sorry for the noise19:38
gmannk19:40

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!