-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement spec change open-telemetry/opamp-spec#190
- Loading branch information
Showing
12 changed files
with
618 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package internal | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
sharedinternal "github.com/open-telemetry/opamp-go/internal" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestWSSenderSetHeartbeatInterval(t *testing.T) { | ||
sender := NewSender(&sharedinternal.NopLogger{}) | ||
|
||
// Default interval should be 30s as per OpAMP Specification | ||
assert.Equal(t, int64((30 * time.Second).Seconds()), sender.heartbeatIntervalSeconds.Load()) | ||
|
||
// negative interval is invalid for http sender | ||
assert.Error(t, sender.SetHeartbeatInterval(-1)) | ||
assert.Equal(t, int64((30 * time.Second).Seconds()), sender.heartbeatIntervalSeconds.Load()) | ||
|
||
// zero is valid for ws sender | ||
assert.NoError(t, sender.SetHeartbeatInterval(0)) | ||
assert.Equal(t, int64(0), sender.heartbeatIntervalSeconds.Load()) | ||
|
||
var expected int64 = 10 | ||
assert.NoError(t, sender.SetHeartbeatInterval(time.Duration(expected)*time.Second)) | ||
assert.Equal(t, expected, sender.heartbeatIntervalSeconds.Load()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule opamp-spec
updated
3 files
+1 −0 | .markdown_link_check_config.json | |
+28 −9 | proto/opamp.proto | |
+101 −30 | specification.md |
Oops, something went wrong.