-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: add retries & update ping/go interop test #32
Merged
laurentsenta
merged 12 commits into
libp2p:master
from
laurentsenta:feat/interop-retries
Aug 29, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f0202d6
.github/workflows/run-composition.yml: retry the build command
laurentsenta 1d83fef
.github/workflows/run-composition.yml: reduce run timeout for now
laurentsenta a09f096
.github/workflows/*: run on push and PR
laurentsenta affa56d
.github/actions: check testground health
laurentsenta 0630c52
ping/_composition/*: reorder lib versions
laurentsenta 21fd8d6
ping/: update with go-libp2p v0.22
laurentsenta ca68ffc
chore: gofmt
laurentsenta f223023
.github/workflows: allow check test-plans during PR and push
laurentsenta 3883920
.github/workflows/*: introduce ping-interop-latest
laurentsenta 940e4b0
.github/workflow: tweak retry + timeout
laurentsenta 27b2a83
.github/actions/setup-testground: retry install
laurentsenta 7985104
ping/rust: update with v0.47.0 release
laurentsenta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testground_endpoint: | ||
type: string | ||
required: false | ||
description: testground endpoint | ||
custom_git_reference: | ||
description: the git commit or branch we're going to use for the custom target | ||
required: false | ||
type: string | ||
custom_git_target: | ||
description: the custom git fork url we're going to use for the custom target (github.com/some-fork/rust-libp2p) | ||
required: false | ||
type: string | ||
custom_interop_target: | ||
description: in the case of cross-implementation testing, the implementation target (go | rust | ...) | ||
required: false | ||
type: string | ||
push: | ||
pull_request: | ||
|
||
name: libp2p ping - go + rust test (latest) with testground. | ||
|
||
jobs: | ||
run-ping-latest: | ||
uses: "./.github/workflows/run-composition.yml" | ||
with: | ||
composition_file: "ping/_compositions/go-rust-interop-latest.toml" | ||
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p" | ||
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference | ||
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust | ||
testground_endpoint: ${{ github.event.inputs.testground_endpoint }} | ||
test_repository: ${{ (github.event.inputs && '') || github.repository }} | ||
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }} |
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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
[[groups]] | ||
Id = "v0.44.0" | ||
CargoFeatures = 'libp2pv0440' | ||
[master] | ||
CargoFeatures = 'libp2pv0480' | ||
|
||
[custom] | ||
CargoFeatures = 'libp2pv0480' | ||
|
||
[[groups]] | ||
Id = "v0.45.1" | ||
CargoFeatures = 'libp2pv0450' | ||
Id = "v0.47.0" | ||
CargoFeatures = 'libp2pv0470' | ||
|
||
[[groups]] | ||
Id = "v0.46.0" | ||
CargoFeatures = 'libp2pv0460' | ||
|
||
[master] | ||
CargoFeatures = 'libp2pv0470' | ||
[[groups]] | ||
Id = "v0.45.1" | ||
CargoFeatures = 'libp2pv0450' | ||
|
||
[custom] | ||
CargoFeatures = 'libp2pv0470' | ||
[[groups]] | ||
Id = "v0.44.0" | ||
CargoFeatures = 'libp2pv0440' |
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,37 @@ | ||
//go:build v0.22 | ||
// +build v0.22 | ||
|
||
package compat | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/libp2p/go-libp2p" | ||
"github.com/libp2p/go-libp2p/config" | ||
"github.com/libp2p/go-libp2p/core/host" | ||
"github.com/libp2p/go-libp2p/core/peer" | ||
|
||
noise "github.com/libp2p/go-libp2p/p2p/security/noise" | ||
tls "github.com/libp2p/go-libp2p/p2p/security/tls" | ||
) | ||
|
||
type PeerAddrInfo = peer.AddrInfo | ||
|
||
func NewLibp2(ctx context.Context, secureChannel string, opts ...config.Option) (host.Host, error) { | ||
security := getSecurityByName(secureChannel) | ||
|
||
return libp2p.New( | ||
append(opts, security)..., | ||
) | ||
} | ||
|
||
func getSecurityByName(secureChannel string) libp2p.Option { | ||
switch secureChannel { | ||
case "noise": | ||
return libp2p.Security(noise.ID, noise.New) | ||
case "tls": | ||
return libp2p.Security(tls.ID, tls.New) | ||
} | ||
panic(fmt.Sprintf("unknown secure channel: %s", secureChannel)) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to sleep in between retries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retry might happen almost instantaneously because of the docker caching. The goal here is to wait some time to give remote services a chance to improve the situation (like the 404 above).
I'll merge as is, but there will be at least one follow-up PR for improvements, where we can remove this sleep if we don't want it.