-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into flex-roadmap-traffic-splitting
# Conflicts: # CHANGELOG.md
- Loading branch information
Showing
47 changed files
with
531 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Flaky tests | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
paths-ignore: | ||
- 'readme.md' | ||
|
||
jobs: | ||
flaky_test: | ||
name: flaky_test | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_OPTS: '-Dfile.encoding=utf-8 -Dorg.gradle.daemon=false' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
|
||
- uses: gradle/wrapper-validation-action@v1 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Flaky tests | ||
run: ./gradlew clean -Penvironment=integration :envoy-control-tests:flakyTest | ||
|
||
- name: Junit report | ||
uses: mikepenz/action-junit-report@v2 | ||
if: always() | ||
with: | ||
report_paths: '**/build/test-results/test/TEST-*.xml' | ||
|
||
- name: Cleanup Gradle Cache | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties |
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
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
22 changes: 22 additions & 0 deletions
22
envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/utils/Ports.kt
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,22 @@ | ||
package pl.allegro.tech.servicemesh.envoycontrol.utils | ||
|
||
import java.net.ServerSocket | ||
import pl.allegro.tech.servicemesh.envoycontrol.logger | ||
|
||
object Ports { | ||
private val usedPorts: MutableSet<Int> = mutableSetOf() | ||
val logger by logger() | ||
|
||
@Synchronized | ||
fun nextAvailable(): Int { | ||
var randomPort: Int | ||
do { | ||
randomPort = ServerSocket(0).use { it.localPort } | ||
} while (usedPorts.contains(randomPort)) | ||
usedPorts.add(randomPort) | ||
logger.info("Generated port: {}", randomPort) | ||
logger.info("Used ports: {}", usedPorts) | ||
|
||
return randomPort | ||
} | ||
} |
Oops, something went wrong.