We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
GetStaleTimestamp
This test may return future TSO when calling GetStaleTimestamp, which is a correctness risk.
func TestNonFutureStaleTSO(t *testing.T) { o := oracles.NewEmptyPDOracle() oracles.SetEmptyPDOracleLastTs(o, oracle.GoTimeToTS(time.Now())) for i := 0; i < 100; i++ { time.Sleep(10 * time.Millisecond) now := time.Now() upperBound := now.Add(5 * time.Millisecond) // allow 5ms time drift closeCh := make(chan struct{}) go func() { time.Sleep(100 * time.Microsecond) oracles.SetEmptyPDOracleLastTs(o, oracle.GoTimeToTS(now)) close(closeCh) }() CHECK: for { select { case <-closeCh: break CHECK default: ts, err := o.GetStaleTimestamp(context.Background(), oracle.GlobalTxnScope, 0) assert.Nil(t, err) staleTime := oracle.GetTimeFromTS(ts) if staleTime.After(upperBound) && time.Since(now) < time.Millisecond /* only check staleTime within 1ms */ { assert.Less(t, staleTime, upperBound, i) t.FailNow() } } } } }
The test should pass because stale timestamp should not be a future ts. But we got:
Error: "2023-11-09 15:44:50.757 +0900 JST" is not less than "2023-11-09 15:44:50.751395 +0900 JST m=+0.030711501"
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
This test may return future TSO when calling
GetStaleTimestamp
, which is a correctness risk.The test should pass because stale timestamp should not be a future ts. But we got:
The text was updated successfully, but these errors were encountered: