Skip to content

Commit

Permalink
#699 Fix Bugsnag being initialized during tests (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotradamczyk5 authored May 21, 2020
1 parent 0d8cfa4 commit b8c2ca1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
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

0 comments on commit b8c2ca1

Please sign in to comment.