test: keep deferred read diagnostic helpers with their build tag

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-10-25 18:40:40 +08:00
parent 2a04d5f485
commit ee3e7ea716
2 changed files with 20 additions and 19 deletions
-19
View File
@@ -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
// capability must not split the quorum of otherwise identical object contents.
func TestMutationPartialNoopPreservesReadability(t *testing.T) {
+20
View File
@@ -9,6 +9,7 @@
package cmd
import (
"context"
xhttp "github.com/minio/minio/internal/http"
"io"
"strconv"
@@ -196,3 +197,22 @@ func uniformLatestVersion(meta []FileInfo, errs []error) bool {
}
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
}