mirror of
https://github.com/pgsty/minio.git
synced 2026-10-29 12:07:20 +03:00
test: keep deferred read diagnostic helpers with their build tag
Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -605,25 +605,6 @@ func TestMutationCanceledSuccessfulCommitIsNotUndone(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type orderedRenameDisk struct {
|
|
||||||
StorageAPI
|
|
||||||
early bool
|
|
||||||
earlyDone chan<- struct{}
|
|
||||||
release <-chan struct{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d orderedRenameDisk) RenameData(ctx context.Context, sv, sp string, fi FileInfo, dv, dp string, opts RenameOptions) (RenameDataResp, error) {
|
|
||||||
if !d.early {
|
|
||||||
<-d.release
|
|
||||||
}
|
|
||||||
r, err := d.StorageAPI.RenameData(ctx, sv, sp, fi, dv, dp, opts)
|
|
||||||
if d.early {
|
|
||||||
d.earlyDone <- struct{}{}
|
|
||||||
<-d.release
|
|
||||||
}
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Partial no-op updates may revoke undo on only some disks. That internal
|
// Partial no-op updates may revoke undo on only some disks. That internal
|
||||||
// capability must not split the quorum of otherwise identical object contents.
|
// capability must not split the quorum of otherwise identical object contents.
|
||||||
func TestMutationPartialNoopPreservesReadability(t *testing.T) {
|
func TestMutationPartialNoopPreservesReadability(t *testing.T) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
xhttp "github.com/minio/minio/internal/http"
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -196,3 +197,22 @@ func uniformLatestVersion(meta []FileInfo, errs []error) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type orderedRenameDisk struct {
|
||||||
|
StorageAPI
|
||||||
|
early bool
|
||||||
|
earlyDone chan<- struct{}
|
||||||
|
release <-chan struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d orderedRenameDisk) RenameData(ctx context.Context, sv, sp string, fi FileInfo, dv, dp string, opts RenameOptions) (RenameDataResp, error) {
|
||||||
|
if !d.early {
|
||||||
|
<-d.release
|
||||||
|
}
|
||||||
|
r, err := d.StorageAPI.RenameData(ctx, sv, sp, fi, dv, dp, opts)
|
||||||
|
if d.early {
|
||||||
|
d.earlyDone <- struct{}{}
|
||||||
|
<-d.release
|
||||||
|
}
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user