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

Fix lock_test.go/TestLockTTL #122

Open
czt1999 opened this issue Apr 13, 2022 · 0 comments
Open

Fix lock_test.go/TestLockTTL #122

czt1999 opened this issue Apr 13, 2022 · 0 comments

Comments

@czt1999
Copy link

czt1999 commented Apr 13, 2022

In lock_test.go, settings of lock TTL are shrunk together to speed up tests:

func init() {
    // Speed up tests.
    defaultLockTTL = 3
    maxLockTTL = 120
    ttlFactor = 6
    oracleUpdateInterval = 2
}

However, the remaining code still applies millisecond while computing elapsed time (ex.2pc.go/txnLockTTL), which will add a relatively large bias on the basic formula ttl = ttlFactor * sqrt(sizeInMiB).

In addition, ttlEquals ignores case that x < y, where float(x - y) will result in a wrong answer given x and y of uint type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant