aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_check_disk_test.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2025-11-04 22:02:22 +0100
committerGitHub <noreply@github.com>2025-11-04 13:02:22 -0800
commitf466ff1412005f3db10de9dc4939e52cb4a2add8 (patch)
tree13d7a135fc7b20b94c95631b1477ad7b82ca6927 /weed/shell/command_volume_check_disk_test.go
parentf4f2718ba05b13c51f14a316c48a256da6a77fe8 (diff)
downloadseaweedfs-f466ff1412005f3db10de9dc4939e52cb4a2add8.tar.xz
seaweedfs-f466ff1412005f3db10de9dc4939e52cb4a2add8.zip
Nit: use `time.Duration`s instead of constants in seconds. (#7438)
Nit: use `time.Durations` instead of constants in seconds. Makes for slightly more readable code.
Diffstat (limited to 'weed/shell/command_volume_check_disk_test.go')
-rw-r--r--weed/shell/command_volume_check_disk_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/shell/command_volume_check_disk_test.go b/weed/shell/command_volume_check_disk_test.go
index ab9832bd4..d86b40f1f 100644
--- a/weed/shell/command_volume_check_disk_test.go
+++ b/weed/shell/command_volume_check_disk_test.go
@@ -1,9 +1,11 @@
package shell
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"os"
"testing"
+ "time"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
type testCommandVolumeCheckDisk struct {
@@ -65,7 +67,8 @@ func TestShouldSkipVolume(t *testing.T) {
},
}
for num, tt := range tests {
- if isShould := cmdVolumeCheckDisk.shouldSkipVolume(&tt.a, &tt.b, tt.pulseTimeAtSecond, true, true); isShould != tt.shouldSkipVolume {
+ pulseTime := time.Unix(tt.pulseTimeAtSecond, 0)
+ if isShould := cmdVolumeCheckDisk.shouldSkipVolume(&tt.a, &tt.b, pulseTime, true, true); isShould != tt.shouldSkipVolume {
t.Fatalf("result of should skip volume is unexpected for %d test", num)
}
}