-
Notifications
You must be signed in to change notification settings - Fork 2.3k
optimized the execution flow of the TestRowsColumnTypes unit test #1425
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
Conversation
It seems just hiding real problem. I don't think it is good idea. |
driver_test.go
Outdated
continue | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this code here:
if t.Failed() {
return
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this code?
I tested it and the code does seem more appropriate.
for i := range values {
if types[i] == nil {
t.Failed()
return
}
values[i] = reflect.New(types[i]).Interface()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Just put my code here.
I think types[i] == nil
happens only when test is already failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree.
I will resubmit a pull request.
driver_test.go
Outdated
for i := range values { | ||
if types[i] == nil { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense at all. Remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
Description
Please explain the changes you made here.

When running the TestRowsColumnTypes unit test on OceanBase, I encountered a panic and the test progress was forced to exit.
Adding this defensive strategy can prevent the occurrence of panic issues and thus prevent blocking the execution of the unit test.
Checklist