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

[TT-626] Fixes Odd Exit Code #10900

Merged
merged 1 commit into from
Oct 10, 2023
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
4 changes: 3 additions & 1 deletion integration-tests/scripts/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ exit_code=$?

echo "Test exit code: ${exit_code}"

if [ $exit_code -eq 2 ]; then # 2 is the code for an interrupted test, we only want to restart the test when the test is interrupted
# 3 is the code for an interrupted test, we only want to restart the test when the test is interrupted and in a state
# that it can recover from. Otherwise we mark the test as "passed" as far as K8s is concerned so it doesn't restart it.
if [ $exit_code -eq 3 ]; then
exit 1 # Exiting with non-zero status to trigger pod restart
fi

Expand Down
2 changes: 0 additions & 2 deletions integration-tests/testsetups/keeper_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ func (k *KeeperBenchmarkTest) Setup(t *testing.T, env *environment.Environment)
}
}

var ()

c := inputs.Contracts

if common.IsHexAddress(c.LinkTokenAddress) {
Expand Down
7 changes: 5 additions & 2 deletions integration-tests/testsetups/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ import (
"github.com/smartcontractkit/chainlink/integration-tests/testreporters"
)

const saveFileLocation = "/persistence/ocr-soak-test-state.toml"
const (
saveFileLocation = "/persistence/ocr-soak-test-state.toml"
interruptedExitCode = 3
)

// OCRSoakTest defines a typical OCR soak test
type OCRSoakTest struct {
Expand Down Expand Up @@ -485,7 +488,7 @@ func (o *OCRSoakTest) testLoop(testDuration time.Duration, newValue int) {
o.log.Error().Err(err).Msg("Error saving state")
}
o.log.Warn().Str("Time Taken", time.Since(saveStart).String()).Msg("Saved state")
os.Exit(2) // Exit with code 2 to indicate test was interrupted, not just a normal failure
os.Exit(interruptedExitCode) // Exit with interrupted code to indicate test was interrupted, not just a normal failure
case <-endTest:
return
case <-newRoundTrigger.C:
Expand Down
Loading