-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Adding ppc64le specific fixes for tests "expression/builtin_math_test.go" and "store/tikv/lock_test.go" #3477
Conversation
….go" and "store/tikv/lock_test.go"
Good job. |
@YugandhaD CI failed. Please make sure you could pass |
Yes, I am looking into it to fix this. |
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.
Rest LGTM
expression/builtin_math_test.go
Outdated
c.Assert(err, t.err) | ||
c.Assert(v, testutil.DatumEquals, types.NewDatum(t.ret)) | ||
if runtime.GOARCH == "ppc64le" { | ||
for _, t := range []struct { |
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.
testcases := []struct {...} {...}
for _, t := range testcases {
}
expression/builtin_math_test.go
Outdated
c.Assert(v, testutil.DatumEquals, types.NewDatum(t.ret)) | ||
} | ||
} else { | ||
for _, t := range []struct { |
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.
ditto
store/tikv/lock_test.go
Outdated
. "github.com/pingcap/check" | ||
"github.com/pingcap/kvproto/pkg/kvrpcpb" | ||
"github.com/pingcap/tidb/kv" | ||
"github.com/pingcap/tidb/store/tikv/tikvrpc" | ||
goctx "golang.org/x/net/context" | ||
"math" |
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 Go standard packages first, then third-part packages, split with a newline.
@tiancaiamao I have optimized my code as per your suggestions , and the CI for c18161d also passing now. Could you please have a look once? |
LGTM |
LGTM |
Thanks! |
Changes made in: I have changed two test cases.
The changes were required because of the different behavior of some casting and exponential operations on ppc64le platform.
Two tests “github.com/pingcap/tidb/store/tikv”, and “github.com/pingcap/tidb/expression”, are failing on ppc64le platform.
• For “github.com/pingcap/tidb/store/tikv”:
This tests is failing as its subtest “lock_test.go” fails. The test fails with assertion error, which is due to the casting operation in the test where float is casted to a signed int. However, on ppc64le, all integers are unsigned integers by default, so we need to do the casting separately. I have updated it in the patch and changes I made are ppc64le specific.
• For “github.com/pingcap/tidb/expression”:
This test case was also failing with assertion error for builtin_math_test.go. The main cause of the assertion error here was an exponential operation being performed. For math.Exp(1), both x86 and ppc64le shows up different values. For x86 the value is 2.718281828459045 and for ppc64le the value is 2.7182818284590455 where we can see a single digit precision difference. I have changed the test case accordingly in case of ppc64le.
I have raised a github issue for above test failure: #3376