You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by li...@apache.org on 2021/11/08 12:57:26 UTC

[skywalking-infra-e2e] branch main updated: Parse interval without setting value (#66)

This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git


The following commit(s) were added to refs/heads/main by this push:
     new 9de4932  Parse interval without setting value (#66)
9de4932 is described below

commit 9de4932ca5e8a8f9e7c881c8bd95a7a440d6631a
Author: John Niang <jo...@fastmail.com>
AuthorDate: Mon Nov 8 20:57:14 2021 +0800

    Parse interval without setting value (#66)
---
 commands/verify/verify.go      | 2 ++
 commands/verify/verify_test.go | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/commands/verify/verify.go b/commands/verify/verify.go
index 740c4c3..83cf46a 100644
--- a/commands/verify/verify.go
+++ b/commands/verify/verify.go
@@ -133,6 +133,8 @@ and will be removed in future version, please use Duration style instead, such a
 		if interval, err = time.ParseDuration(itv); err != nil {
 			return 0, err
 		}
+	case nil:
+		interval = 0
 	default:
 		return 0, fmt.Errorf("failed to parse verify.retry.interval: %v", retryInterval)
 	}
diff --git a/commands/verify/verify_test.go b/commands/verify/verify_test.go
index 89c1e80..e890f10 100644
--- a/commands/verify/verify_test.go
+++ b/commands/verify/verify_test.go
@@ -54,6 +54,11 @@ func Test_parseInterval(t *testing.T) {
 			name:    "Should fail in other cases",
 			args:    args{retryInterval: "abcdef"},
 			wantErr: true,
+		}, {
+			name:    "Should parse interval without setting value",
+			args:    args{},
+			want:    0,
+			wantErr: false,
 		},
 	}
 	for _, tt := range tests {