Skip to content

Fix lock_test.go/TestLockTTL #122

@czt1999

Description

@czt1999

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions