Skip to content

Commit

Permalink
GitHub Actions, kind, integration test logs fixes (#3372)
Browse files Browse the repository at this point in the history
PR #3339 introduced a GitHub Actions CI workflow. Booting 6 clusters
simultaneously (3x Github Actions + 3x Travis) exhibits some transient
failures.

Implement fixes in GitHub Actions and integration tests to address kind
cluster creation and testing:
- Retry kind cluster creation once.
- Retry log reading from integration k8s clusters once.
- Add kind cluster creation debug logging.
- Add a GitHub Actions status badge to top of `README.md`.

Signed-off-by: Andrew Seigner <[email protected]>
  • Loading branch information
siggy authored Sep 4, 2019
1 parent bfa251d commit a8481b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ jobs:
run: |
TAG="$(CI_FORCE_CLEAN=1 bin/root-tag)"
export KIND_CLUSTER=github-$TAG-${{ matrix.integration_test }}
bin/kind create cluster --name=$KIND_CLUSTER --wait=1m
# retry cluster creation once in case of port conflict or kubeadm failure
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --loglevel debug ||
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --loglevel debug
scp $(bin/kind get kubeconfig-path --name=$KIND_CLUSTER) github@$DOCKER_ADDRESS:/tmp
kind_integration:
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ jobs:
- |
# create kind cluster
export KIND_CLUSTER=travis-$TRAVIS_BUILD_ID-$INTEGRATION_TEST
bin/kind create cluster --name=$KIND_CLUSTER
# retry cluster creation once in case of port conflict or kubeadm failure
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --loglevel debug ||
bin/kind create cluster --name=$KIND_CLUSTER --wait=2m --loglevel debug
- |
# Save kubeconfig to remote docker host for kind integration test stages.
scp $(bin/kind get kubeconfig-path --name=$KIND_CLUSTER) $USER@$REMOTE_DOCKER:/tmp
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![Linkerd][logo]

[![Build Status][ci-badge]][ci]
[![GitHub Actions Status][github-actions-badge]][github-actions]
[![GitHub license][license-badge]](LICENSE)
[![Go Report Card][go-report-card-badge]][go-report-card]
[![Slack Status][slack-badge]][slack]
Expand Down Expand Up @@ -75,6 +76,8 @@ specific language governing permissions and limitations under the License.
<!-- refs -->
[ci]: https://travis-ci.org/linkerd/linkerd2
[ci-badge]: https://travis-ci.org/linkerd/linkerd2.svg?branch=master
[github-actions]: https://github.com/linkerd/linkerd2/actions
[github-actions-badge]: https://github.com/linkerd/linkerd2/workflows/CI/badge.svg
[cncf]: https://www.cncf.io/
[coc]: https://github.com/linkerd/linkerd/wiki/Linkerd-code-of-conduct
[getting-started]: https://linkerd.io/2/getting-started/
Expand Down
7 changes: 6 additions & 1 deletion test/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@ func TestLogs(t *testing.T) {
// does not return 10,000 after 2 seconds. We don't need 10,000 log lines.
outputLines, _ := outputStream.ReadUntil(10000, 2*time.Second)
if len(outputLines) == 0 {
t.Errorf("No logs found for %s", name)
// Retry one time for 30 more seconds, in case the cluster is slow to
// produce log lines.
outputLines, _ = outputStream.ReadUntil(10000, 30*time.Second)
if len(outputLines) == 0 {
t.Errorf("No logs found for %s", name)
}
}

for _, line := range outputLines {
Expand Down

0 comments on commit a8481b7

Please sign in to comment.