Skip to content

Commit

Permalink
JPERF-566: Fix CI flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
dagguh committed Sep 6, 2019
1 parent 344ac4b commit faa8014
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build_template: &build_template
key: v1-dependencies-{{ checksum "build.gradle.kts" }}
- run:
command: ./gradlew build
no_output_timeout: 25m
no_output_timeout: 30m
- store_artifacts:
path: ./build/reports/tests
destination: test-reports
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
}.forEach { implementation(it) }
testCompile("org.assertj:assertj-core:3.11.0")
testCompile("com.atlassian.performance.tools:io:[1.0.0,2.0.0)")
testCompile("com.atlassian.performance.tools:docker-infrastructure:0.2.0")
testCompile("com.atlassian.performance.tools:docker-infrastructure:0.3.0")
testCompile("junit:junit:4.12")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.google.code.findbugs:jsr305:1.3.9
com.google.code.gson:gson:2.8.2
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependency-locks/testCompile.lockfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.google.code.findbugs:jsr305:1.3.9
com.google.code.gson:gson:2.8.2
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependency-locks/testCompileClasspath.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:concurrency:1.0.0
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.atlassian.performance.tools:jvm-tasks:1.0.0
com.github.stephenc.jcip:jcip-annotations:1.0-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:concurrency:1.0.0
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.atlassian.performance.tools:jvm-tasks:1.0.0
com.github.stephenc.jcip:jcip-annotations:1.0-1
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependency-locks/testRuntime.lockfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.google.code.findbugs:jsr305:1.3.9
com.google.code.gson:gson:2.8.2
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependency-locks/testRuntimeClasspath.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.atlassian.performance.tools:concurrency:1.0.0
com.atlassian.performance.tools:docker-infrastructure:0.2.0
com.atlassian.performance.tools:docker-infrastructure:0.3.0
com.atlassian.performance.tools:io:1.2.0
com.atlassian.performance.tools:jvm-tasks:1.0.0
com.github.stephenc.jcip:jcip-annotations:1.0-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,24 @@ class JiraCoreScenarioIT {
override fun remember(memories: Collection<User>) = throw Exception("not implemented")
}

val diagnoses = Paths.get("diagnoses")
val testOutput = JiraCoreFormula.Builder()
.version(version)
.diagnoses(Paths.get("diagnoses"))
.diagnoses(diagnoses)
.build()
.provision()
.use { jira ->
DockerisedChrome().start().use useBrowser@{ browser ->
val driver = browser.driver
return@useBrowser try {
test(driver, jira, actionMeter, userMemory)
} catch (e: Exception) {
WebDriverDiagnostics(driver).diagnose(e)
throw Exception("Testing with WebDriver failed, look for diagnoses", e)
DockerisedChrome(diagnoses.resolve("recordings"))
.start()
.use useBrowser@{ browser ->
val driver = browser.driver
return@useBrowser try {
test(driver, jira, actionMeter, userMemory)
} catch (e: Exception) {
WebDriverDiagnostics(driver).diagnose(e)
throw Exception("Testing with WebDriver failed, look for diagnoses", e)
}
}
}
}

val results = metrics.map { it.result }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,42 @@ class RichTextEditorIT {
}
}

val diagnoses = Paths.get("diagnoses")
JiraCoreFormula.Builder()
.version(version)
.diagnoses(Paths.get("diagnoses"))
.diagnoses(diagnoses)
.build()
.provision()
.use { jira ->
DockerisedChrome().start().use { browser ->
val webJira = WebJira(
browser.driver,
jira.getUri(),
user.password
)
val logInAction = scenario.getLogInAction(
webJira,
actionMeter,
userMemory
)
val actions = scenario.getActions(
webJira,
SeededRandom(123),
actionMeter
)

logInAction.run()
actions.forEach { action ->
action.run()
DockerisedChrome(diagnoses.resolve("recordings"))
.start()
.use { browser ->
val webJira = WebJira(
browser.driver,
jira.getUri(),
user.password
)
val logInAction = scenario.getLogInAction(
webJira,
actionMeter,
userMemory
)
val actions = scenario.getActions(
webJira,
SeededRandom(123),
actionMeter
)
logInAction.run()
actions.forEach { action ->
action.run()
}
}
}
}

val results = metrics.map { metric ->
metric.result
}
Assertions.assertThat(results).containsOnly(ActionResult.OK)

}
}

Expand Down

0 comments on commit faa8014

Please sign in to comment.