Skip to content
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

testSuiteAgg.TestAggregation, testIntegrationSuite2.TestMathBuiltin,TestTan fails on macOS #29737

Closed
zhangyangyu opened this issue Nov 12, 2021 · 1 comment
Labels
component/test severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@zhangyangyu
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

make test

2. What did you expect to see? (Required)

All test cases pass.

3. What did you see instead (Required)

testSuiteAgg.TestAggregation, testIntegrationSuite2.TestMathBuiltin,TestTan fail due to float number precision.

FAIL: aggregate_test.go:57: testSuiteAgg.TestAggregation

aggregate_test.go:412:
    result.Check(testkit.Rows("2584338.6666666665 29.840000178019228 1.1808222222222229 12.666666666666666"))
/Users/zhangyangyu/repos/tidb/util/testkit/testkit.go:67:
    res.c.Assert(resBuff.String(), check.Equals, needBuff.String(), res.comment)
... obtained string = "[2584338.6666666665 29.840000178019228 1.1808222222222222 12.666666666666666]\n"
... expected string = "[2584338.6666666665 29.840000178019228 1.1808222222222229 12.666666666666666]\n"
... sql:select variance(b), variance(c), variance(d), variance(e) from t group by a, args:[]
FAIL: integration_test.go:413: testIntegrationSuite2.TestMathBuiltin

integration_test.go:441:
    result.Check(testkit.Rows("0 1"))
/Users/zhangyangyu/repos/tidb/util/testkit/testkit.go:67:
    res.c.Assert(resBuff.String(), check.Equals, needBuff.String(), res.comment)
... obtained string = "[0 0.9999999999999998]\n"
... expected string = "[0 1]\n"
... sql:select tan(0.00), tan(PI()/4), args:[]
--- FAIL: TestTan (0.00s)
    builtin_math_test.go:1023:
                Error Trace:    builtin_math_test.go:1023
                Error:          Not equal:
                                expected: 1
                                actual  : 0.9999999999999998
                Test:           TestTan

4. What is your TiDB version? (Required)

master branch
golang 1.17.2
macOS 12.0.1 M1 chip

On macOS, the expression math.Tan(math.Pi/4) gives different result than on Linux.

@zhangyangyu zhangyangyu added the type/bug The issue is confirmed as a bug. label Nov 12, 2021
@jebter jebter added the sig/execution SIG execution label Dec 7, 2021
@tiancaiamao
Copy link
Contributor

Now we run make ut and it should be stable after #30822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants