Skip to content
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

#699 Fix Bugsnag being initialized during tests #807

Merged
merged 2 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [#784](https://github.com/Flank/flank/pull/784) Add output-style option. ([jan-gogo](https://github.com/jan-gogo))
- [#779](https://github.com/Flank/flank/pull/779) Print retries & display additional info. ([jan-gogo](https://github.com/jan-gogo))
- [#793](https://github.com/Flank/flank/issues/793) Better error message on file not found. ([adamfilipow92](https://github.com/adamfilipow92))
-
- [#807](https://github.com/Flank/flank/issues/807) Fix Bugsnag being initialized during tests. ([piotradamczyk5](https://github.com/piotradamczyk5))
-

## v20.05.2
Expand Down
7 changes: 3 additions & 4 deletions test_runner/src/main/kotlin/ftl/config/FtlConstants.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ftl.config

import com.bugsnag.Bugsnag
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.googleapis.util.Utils
import com.google.api.client.http.GoogleApiLogger
Expand Down Expand Up @@ -54,10 +55,8 @@ object FtlConstants {

val JSON_FACTORY: JsonFactory by lazy { Utils.getDefaultJsonFactory() }

val bugsnag = initBugsnag(useMock)

init {
bugsnag?.setAppVersion(readRevision())
val bugsnag: Bugsnag? by lazy {
initBugsnag(useMock)?.apply { setAppVersion(readRevision()) }
}

val httpTransport: NetHttpTransport by lazy {
Expand Down
6 changes: 1 addition & 5 deletions test_runner/src/main/kotlin/ftl/util/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ fun withGlobalExceptionHandling(block: () -> Int) {
// We need to cover the case where some component in the call stack starts a non-daemon
// thread, and then throws an Error that kills the main thread. This is extra safe implementation
else -> {
// this is workaround for Bugsnag initialization bug, should be removed when resolved
// https://github.com/Flank/flank/issues/699
if (FtlConstants.useMock.not()) {
FtlConstants.bugsnag?.notify(t)
}
FtlConstants.bugsnag?.notify(t)
t.printStackTrace()
exitProcess(3)
}
Expand Down