-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old comments from deleted test case runs appearing in newly created test case runs #1028
Comments
I am now deleting all comments for all test cases using fabricated post requests to https://kiwi.sysct.cz/comments/delete/ .... and will let you know, it it works correctly afterwards... |
@cloudbloat any update here? |
Thanks for interest. After deleting all comments manually it works perfectly now, IDs are now not overlapping and each new comment has new ID (it doesn't recycle IDs, but increase them). I dont know what caused it, maybe incorrect usage from my side. |
So it happened again after restarting our kiwi server...I will try to investigate more and provide more informations.... |
@atodorov may I ask if there is way to see all existing comments in KIWI mariaDB ? To better investigate problem...(I searched but couldnt find a way) |
|
So I have deleted all test runs - running and stopped ones, and thanks to your help, I am able to find that there exists still many comments .... Shouldnt they all be deleted with the test runs ? (I insert the comments using: rpc_client.exec.TestExecution.add_comment(int(test_case_run_id), str(comment))) |
Can you post the script which creates these comments? Something isn't right here but without a reproducer there's nothing we can do to debug and figure it out. |
Several notes:
We need more information here:
When you see comments, which you think must not be there inspect both of the IDs for them and post the findings here.
The only thing I can imagine that may be happening is that originally you've created many test runs/executions and comments and now after the deletion your TE (TestCaseRun in older versions) objects are being created with the same IDs and these older comments get assigned to them. I can't reproduce this behavior, i.e. when I delete something the next object is created with an ID which is +1 of the old ID. Notice: I do see something strage in my exploration. |
Q/A:
(> The only thing I can imagine that may be happening is that originally you've created many test runs/executions and comments and now after the deletion your TE (TestCaseRun in older versions) objects are being created with the same IDs and these older comments get assigned to them.
|
- this field is not used when removing comments. Only comment_id is actually used! - get_details_case_run.html was displaying the wrong value for object_pk: it was showing TC.pk instead of TE.pk
instead of flagging comments as removed delete them from DB
we do this with a pre-delete signal b/c the object_pk field isn't a FK relationship but rather an integer field so we can't rely on a cascading delete!
There are a number of issues here:
1-3 will be solved by #1220 which will also close this issue.
We still don't have enough information to figure out why this was happening in the first place. The only pointers I can give you is to check how transactions on your MariaDB have been configured. Maybe also look at sequences and auto-increment (LAST_INSERT_ID) settings. I can't reproduce and it's outside the scope of this issue anyway. With the merging of deletion changes even if IDs are recycled the problem of seeing older comments should be less prominent. Will be non existent if you manually remove all comments for which object_pk doesn't point anywhere.
In your last comment you also state
If you have operations pending towards an existing object and you delete that same object from the DB then the behavior is undefined. Transactional settings on your DB engine will likely have effect here. This may or may not be a contributing factor to issue 4). In any case I don't think there's something we can do about it on our end. If you continue to see 4) and 5) please collect more debugging information & steps to reproduce and open another issue. |
- this field is not used when removing comments. Only comment_id is actually used! - get_details_case_run.html was displaying the wrong value for object_pk: it was showing TC.pk instead of TE.pk
instead of flagging comments as removed delete them from DB
we do this with a pre-delete signal b/c the object_pk field isn't a FK relationship but rather an integer field so we can't rely on a cascading delete!
- this field is not used when removing comments. Only comment_id is actually used! - get_details_case_run.html was displaying the wrong value for object_pk: it was showing TC.pk instead of TE.pk
instead of flagging comments as removed delete them from DB
we do this with a pre-delete signal b/c the object_pk field isn't a FK relationship but rather an integer field so we can't rely on a cascading delete!
- this field is not used when removing comments. Only comment_id is actually used! - get_details_case_run.html was displaying the wrong value for object_pk: it was showing TC.pk instead of TE.pk
instead of flagging comments as removed delete them from DB
Fix Confirmed - Thank you very much !!! Now it works without described problems :) |
should have been added in 77c1e1a but it wasn't
should have been added in 77c1e1a but it wasn't
I used to have thousands of test case runs with many comments in each... I created simple selenium script, which deleted these test case runs through gui (Login to Kiwi, filter test case runs, click delete, confirm it. Again.).
Deletion was ok but now when I create new test case run, right after it is created with old comments from deleted runs in it....
I am unable to get into database to clear comments, and not sure if it would be enough..

The text was updated successfully, but these errors were encountered: