Skip to content

Commit

Permalink
remove timeout from script definition as it is unused
Browse files Browse the repository at this point in the history
  • Loading branch information
harp-intel committed Dec 10, 2024
1 parent 122b77d commit 472d7a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
15 changes: 1 addition & 14 deletions internal/script/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ import (
//go:embed resources
var Resources embed.FS

type ScriptDefinition struct {
Name string // just a name
Script string // the bash script that will be run
Architectures []string // architectures, i.e., x86_64, arm64. If empty, it will run on all architectures.
Families []string // families, e.g., 6, 7. If empty, it will run on all families.
Models []string // models, e.g., 62, 63. If empty, it will run on all models.
Lkms []string // loadable kernel modules
Depends []string // binary dependencies that must be available for the script to run
Superuser bool // requires sudo or root
Sequential bool // run script sequentially (not at the same time as others)
Timeout int // seconds
}

type ScriptOutput struct {
ScriptDefinition
Stdout string
Expand Down Expand Up @@ -254,7 +241,7 @@ func RunScriptAsync(myTarget target.Target, script ScriptDefinition, localTempDi
}()
}
cmd := prepareCommand(script, myTarget.GetTempDirectory())
err = myTarget.RunCommandAsync(cmd, stdoutChannel, stderrChannel, exitcodeChannel, script.Timeout, cmdChannel)
err = myTarget.RunCommandAsync(cmd, stdoutChannel, stderrChannel, exitcodeChannel, 0, cmdChannel)
errorChannel <- err
}

Expand Down
12 changes: 12 additions & 0 deletions internal/script/script_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ import (
"strings"
)

type ScriptDefinition struct {
Name string // just a name
Script string // the bash script that will be run
Architectures []string // architectures, i.e., x86_64, arm64. If empty, it will run on all architectures.
Families []string // families, e.g., 6, 7. If empty, it will run on all families.
Models []string // models, e.g., 62, 63. If empty, it will run on all models.
Lkms []string // loadable kernel modules
Depends []string // binary dependencies that must be available for the script to run
Superuser bool // requires sudo or root
Sequential bool // run script sequentially (not at the same time as others)
}

const (
HostnameScriptName = "hostname"
DateScriptName = "date"
Expand Down
3 changes: 0 additions & 3 deletions internal/script/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestRunScript(t *testing.T) {
Superuser: superuser,
Lkms: []string{},
Depends: []string{},
Timeout: 0,
}
tempDir, err := os.MkdirTemp(os.TempDir(), "test")
if err != nil {
Expand Down Expand Up @@ -73,7 +72,6 @@ echo "Core Count: $num_cores_per_socket"`,
Superuser: superuser,
Lkms: []string{},
Depends: []string{},
Timeout: 0,
}
tempDir, err = os.MkdirTemp(os.TempDir(), "test")
if err != nil {
Expand Down Expand Up @@ -109,7 +107,6 @@ mpstat -u -T -I SCPU -P ALL 1 $count`,
Superuser: superuser,
Lkms: []string{},
Depends: []string{"mpstat"},
Timeout: 0,
}
tempDir, err := os.MkdirTemp(os.TempDir(), "test")
if err != nil {
Expand Down

0 comments on commit 472d7a2

Please sign in to comment.