-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
fix flaky mssql test #35640
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
fix flaky mssql test #35640
Conversation
No , the fix is not right. There is no data race for "comment.Repo", it should NOT be used in this test. |
It should fix the test like https://github.com/go-gitea/gitea/actions/runs/18446226509/job/52553328391?pr=35644 but it's not a RACE problem. |
So please propose a correct fix to show your ability. |
Here is another example: https://github.com/go-gitea/gitea/actions/runs/18446226509/job/52553328391 I figured it was a race due to it being flaky, because it only matches the comment type occasionally which I thought meant it was a race due to the comments being made and which one is currently the "latest" for this test. Either way, the code below attempts ensure that when issue&repo are loaded below that they are loaded. |
No , the fix is not right. There is no data race for "comment.Repo", it should NOT be used in this test. Please read the code again. |
To be clear: this PR doesn't fix. If you rerun many times, the flaky test still occur. Because you will get IsForcePush=false, then next assert fails. Since you have wrote so many bugs and don't really understand the code base, I think I should act as a teacher to teach you how to program correctly, but not as a baby sitter to do every fix for you. |
|
No |
Regardless of my assumption on it being a race condition, which is something that could reasonably be assumed about a flaky test of this nature, and others made similar assumptions, this fixes a real problem. It is inappropriate to questions someone ability, and dismiss contributions based on previous bugs. Everyone writes bugs, regardless of their talent, and we shouldn't shame others about it, but rather build others up so that we are all better in the future. |
Sure, everyone writes bugs, including me. But would you respect the reviewer's work? For example: I have left many review suggestions in "Manage User Badges in the UI #31262", I didn't see you have any response or progress. And would you please be responsible? For example: I have asked many times in "ACME certificate fails to renew (incorrect directory) #32191" and "Try to fix ACME path when renew #33668". There are still many similar examples. It seems that you selectively ignore my reviews and questions, it makes me feel that my time is wasted. Is it inappropriate? Why should I spend more time on you? |
OK. FindComments has the correct ordering. But why do tests pass on other databases but fail on MSSQL? I think @wxiaoguang is right — the issue is that the push comments are created asynchronously, so their completion order can vary when FindComments is called. The test only waits for the status change, not for the comment creation to complete. Therefore, this PR doesn’t address the root cause. I understand that everyone has their own strengths and weaknesses. Please remember to address or discuss them privately. |
Replaced by #35647, feel free to delete this PR or my comments if you'd like to. |
In one of my other PRs I noticed that the mssql test was flaky (output here: https://github.com/go-gitea/gitea/actions/runs/18435115337/job/52527538242 ) and it was possible in rare-cases, due to timings, that the else branch below my code was triggered and c.Issue.Repo wasn't loaded causing a nil reference.