Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY autoinstall.template /opt/helpers/
COPY installer.sh /opt/helpers/
COPY entrypoint.sh /entrypoint.sh

ARG GOLANG_VERSION=1.23.5
ARG GOLANG_VERSION=1.23.6

RUN apt-get update && \
apt-get install -y curl wget git gcc make vim libhwloc-dev hwloc software-properties-common man-db && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# This Makefile is used for development and testing purposes only.

IMAGE_NAME = $(shell basename $(CURDIR))
IMAGE_TAG = V901_TAG
IMAGE_TAG = V902_TAG
CONTAINER_NAME = $(IMAGE_NAME)

.PHONY: build
Expand Down
8 changes: 6 additions & 2 deletions pkg/qstat/v9.0/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,11 @@ job-ID prior name user state submit/start at queue
func ParseJobArrayTask(out string) ([]JobArrayTask, error) {
lines := strings.Split(out, "\n")

jobArrayTasks := make([]JobArrayTask, 0, len(lines)-3)
jobArrayTasks := make([]JobArrayTask, 0, len(lines))

if len(lines) < 2 {
return jobArrayTasks, nil
}

for _, line := range lines[2:] {
fields := strings.Fields(line)
Expand All @@ -884,7 +888,7 @@ func ParseJobArrayTask(out string) ([]JobArrayTask, error) {
}
var submitTime time.Time
var startTime time.Time
if strings.Contains(state, "qw") {
if !strings.Contains(state, "qw") {
startTime = jobTime
} else {
submitTime = jobTime
Expand Down
28 changes: 26 additions & 2 deletions pkg/qstat/v9.0/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,37 @@ test.q 0.08 0 0 2 2 0 0
Name: "sleep",
User: "root",
State: "r",
SubmitTime: time.Date(2025, 2, 10, 16, 47, 18, 0, time.UTC),
StartTime: time.Time{},
StartTime: time.Date(2025, 2, 10, 16, 47, 18, 0, time.UTC),
SubmitTime: time.Time{},
Queue: "all.q@master",
Slots: 1,
JaTaskIDs: []int64{1},
},
}))

Expect(jobArrayTasks).To(ContainElement(qstat.JobArrayTask{
JobInfo: qstat.JobInfo{
JobID: 36,
Priority: 0.605,
Name: "sleep",
User: "root",
State: "qw",
SubmitTime: time.Date(2025, 2, 10, 16, 52, 21, 0, time.UTC),
StartTime: time.Time{},
Queue: "",
Slots: 2,
JaTaskIDs: []int64{0},
},
}))

})

It("should parse an empty input", func() {
input := ""
jobArrayTasks, err := qstat.ParseJobArrayTask(input)
Expect(err).NotTo(HaveOccurred())
Expect(len(jobArrayTasks)).To(Equal(0))

})

})
Expand Down
Loading