mirror of
https://gitee.com/juicedata/JuiceFS.git
synced 2025-12-06 17:49:22 +08:00
cmd/objbench: fix the mtime check log of the list results (#6490)
This commit is contained in:
@@ -908,7 +908,7 @@ func functionalTesting(ctx context.Context, blob object.ObjectStorage, result *[
|
||||
}
|
||||
now := time.Now()
|
||||
if objs[1].Mtime().Before(now.Add(-30*time.Second)) || objs[1].Mtime().After(now.Add(time.Second*30)) {
|
||||
return fmt.Errorf("mtime of key should be within 10 seconds, but got %s", objs[1].Mtime().Sub(now))
|
||||
return fmt.Errorf("mtime of key should be within 30 seconds, but got %s", objs[1].Mtime().Sub(now))
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("list failed: %s", err)
|
||||
@@ -934,7 +934,7 @@ func functionalTesting(ctx context.Context, blob object.ObjectStorage, result *[
|
||||
}
|
||||
now := time.Now()
|
||||
if objs[0].Mtime().Before(now.Add(-30*time.Second)) || objs[0].Mtime().After(now.Add(time.Second*30)) {
|
||||
return fmt.Errorf("mtime of key should be within 10 seconds, but got %s", objs[0].Mtime().Sub(now))
|
||||
return fmt.Errorf("mtime of key should be within 30 seconds, but got %s", objs[0].Mtime().Sub(now))
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("list failed: %s", err2)
|
||||
|
||||
@@ -217,7 +217,7 @@ func testStorage(t *testing.T, s ObjectStorage) {
|
||||
}
|
||||
now := time.Now()
|
||||
if objs[1].Mtime().Before(now.Add(-30*time.Second)) || objs[1].Mtime().After(now.Add(time.Second*30)) {
|
||||
t.Fatalf("Mtime of key should be within 10 seconds, but got %s", objs[1].Mtime().Sub(now))
|
||||
t.Fatalf("Mtime of key should be within 30 seconds, but got %s", objs[1].Mtime().Sub(now))
|
||||
}
|
||||
} else {
|
||||
t.Fatalf("list failed: %s", err2.Error())
|
||||
@@ -243,7 +243,7 @@ func testStorage(t *testing.T, s ObjectStorage) {
|
||||
}
|
||||
now := time.Now()
|
||||
if objs[0].Mtime().Before(now.Add(-30*time.Second)) || objs[0].Mtime().After(now.Add(time.Second*30)) {
|
||||
t.Fatalf("Mtime of key should be within 10 seconds, but got %s", objs[0].Mtime().Sub(now))
|
||||
t.Fatalf("Mtime of key should be within 30 seconds, but got %s", objs[0].Mtime().Sub(now))
|
||||
}
|
||||
} else {
|
||||
t.Fatalf("list failed: %s", err2.Error())
|
||||
|
||||
Reference in New Issue
Block a user