Skip to content

Commit

Permalink
misc: rewrote comments following review
Browse files Browse the repository at this point in the history
Signed-off-by: Romain Beuque <romain.beuque@ovhcloud.com>

Co-authored-by: Thomas Schaffer <thomas.schaffer@corp.ovh.com>
  • Loading branch information
rbeuque74 and loopfz committed Jun 29, 2020
1 parent 5b485b1 commit 2389eb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -3,7 +3,7 @@ BINARY = utask
MAIN_LOCATION = ./cmd

TEST_LOCATION = ./...
# timeout for go test is here to prevent test running infinitely if one runResolution lead to a step that never recovers (missing push on a stepChan)
# timeout for go test is here to prevent tests running infinitely if one runResolution leads to a step that never recovers (e.g. missing push on a stepChan)
# 15 seconds per unit tests should be enough
TEST_CMD = go test -count=1 -timeout 15s -v -cover -p 1 ${TEST_LOCATION}
TEST_CMD_COV = ${TEST_CMD} -covermode=count -coverprofile=coverage.out
Expand Down Expand Up @@ -84,4 +84,4 @@ endif

package:

.PHONY: all clean test re package release test test-travis test-docker run-test-stack run-test-stack-docker run-goreleaser docker
.PHONY: all clean test re package release test test-travis test-docker run-test-stack run-test-stack-docker run-goreleaser docker
8 changes: 4 additions & 4 deletions engine/engine.go
Expand Up @@ -589,13 +589,13 @@ func runAvailableSteps(dbp zesty.DBProvider, modifiedSteps map[string]bool, res
// otherwise the task will wait infinitely for this step
}

// after expanding or contracting, need to check if step didn't turned into a bad state (FatalError, ServerError, ...) during the operation
// in that case, it should be discarded from being looked-up during next runAvailableSteps (as we did expanded++)
// after expanding or contracting, need to check if the step didn't turn into a bad state (FatalError, ServerError, ...) during the operation
// if so, it should be ignored during next runAvailableSteps (as we did expanded++)
switch s.State {
case step.StateTODO, step.StateToRetry, step.StateExpanded:
// thoses states could be lead the step to be reconsidered on the next runAvailableSteps if the childrens runs fast enough (and not waiting for the next resolution.Run)
// those states could lead the step to be reconsidered on the next runAvailableSteps if the children run fast enough (and not have to wait for the next resolution.Run)
default:
// others states are errors, we should stop considering this step as eligible during this run
// other states are errors, we should stop considering this step as eligible during this run
executedSteps[s.Name] = true
}
// rebuild step dependency tree to include generated loop steps
Expand Down

0 comments on commit 2389eb8

Please sign in to comment.