Ensure minimum wait time for TestDB_UpdatedAt/WAL test
This commit fixes an issue where the test can be flakey if run on a system with a higher time resolution. It now waits a minimum of at least 100ms.
This commit is contained in:
@@ -100,9 +100,12 @@ func TestDB_UpdatedAt(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
sleepTime := 100 * time.Millisecond
|
||||
if os.Getenv("CI") != "" {
|
||||
time.Sleep(1 * time.Second)
|
||||
sleepTime = 1 * time.Second
|
||||
}
|
||||
time.Sleep(sleepTime)
|
||||
|
||||
if _, err := sqldb.Exec(`CREATE TABLE t (id INT);`); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user