Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-12139: Revert disk_speed_check related changes #441

Merged
merged 2 commits into from Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/disk_speed_check/disk_speed_check.go
Expand Up @@ -2,7 +2,6 @@ package disk_speed_check

import (
"encoding/json"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -101,10 +100,8 @@ func (p *DiskSpeedCheck) getDiskPerf(path string) fioCheckResponse {
return fioCheckResponse{latency: time.Duration(dryModeSyncDurationInNS).Milliseconds(), err: nil}
}

// FIO treats colons as multiple device separator, which breaks paths like /dev/disk/by-path/pci-0000:06:0000.0
escaped_path := strings.ReplaceAll(path, ":", "\\:")
args := []string{"--filename", escaped_path, "--name=test", "--rw=write", "--ioengine=sync",
"--size=22m", "-bs=2300", "--fdatasync=1", "--offset=1M", "--output-format=json"}
args := []string{"--filename", path, "--name=test", "--rw=write", "--ioengine=sync",
"--size=22m", "-bs=2300", "--fdatasync=1", "--output-format=json"}
stdout, stderr, exitCode := p.dependecies.Execute("fio", args...)
if exitCode != 0 {
err := errors.Errorf("Could not get I/O performance for path %s (fio exit code: %d, stderr: %s)",
Expand Down
4 changes: 2 additions & 2 deletions src/disk_speed_check/disk_speed_check_test.go
Expand Up @@ -37,7 +37,7 @@ var _ = Describe("Disk speed check test", func() {
durationInNS := durationInMS * int64(time.Millisecond)
dependencies.On("Execute", "fio", "--filename", file,
mock.Anything, mock.Anything, mock.Anything, mock.Anything,
mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(fmt.Sprintf(
mock.Anything, mock.Anything, mock.Anything).Return(fmt.Sprintf(
`{ "jobs":
[{
"sync":
Expand All @@ -53,7 +53,7 @@ var _ = Describe("Disk speed check test", func() {
fioFailure := func(file string) {
dependencies.On("Execute", "fio", "--filename", file,
mock.Anything, mock.Anything, mock.Anything, mock.Anything,
mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return("", "failure", -1).Once()
mock.Anything, mock.Anything, mock.Anything).Return("", "failure", -1).Once()
}

It("Check succeeded", func() {
Expand Down