Skip to content

Commit

Permalink
revert disabling of submission monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
davidangb committed Apr 25, 2024
1 parent 2d90de4 commit 9ca49a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class AvroUpsertMonitorSpec(_system: ActorSystem)
case class TestApiService(dataSource: SlickDataSource, gcsDAO: MockGoogleServicesDAO, gpsDAO: MockGooglePubSubDAO)(
implicit override val executionContext: ExecutionContext
) extends ApiServices
with MockUserInfoDirectives {
override val startSubmissionMonitor: Boolean = false
}
with MockUserInfoDirectives

def withApiServices[T](dataSource: SlickDataSource)(testCode: TestApiService => T): T = {
val apiService = new TestApiService(dataSource, new MockGoogleServicesDAO("test"), new MockGooglePubSubDAO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import akka.http.scaladsl.server.Route.{seal => sealRoute}
import akka.http.scaladsl.server._
import akka.http.scaladsl.testkit.{RouteTestTimeout, ScalatestRouteTest}
import akka.stream.ActorMaterializer
import akka.testkit.{TestActors, TestKitBase}
import akka.testkit.TestKitBase
import com.typesafe.config.ConfigFactory
import com.typesafe.scalalogging.LazyLogging
import org.broadinstitute.dsde.rawls.RawlsTestUtils
Expand Down Expand Up @@ -157,7 +157,6 @@ trait ApiServiceSpec
val dataSource: SlickDataSource
val gcsDAO: MockGoogleServicesDAO
val gpsDAO: MockGooglePubSubDAO
val startSubmissionMonitor: Boolean = false
val notificationGpsDAO: org.broadinstitute.dsde.workbench.google.mock.MockGooglePubSubDAO =
new org.broadinstitute.dsde.workbench.google.mock.MockGooglePubSubDAO
val mockNotificationDAO: NotificationDAO = mock[NotificationDAO]
Expand Down Expand Up @@ -192,27 +191,21 @@ trait ApiServiceSpec

val config = SubmissionMonitorConfig(5 seconds, 30 days, true, 20000, true)
val testConf = ConfigFactory.load()
// for tests that don't need it, don't even start any cromwell submission monitors.
// this cuts down on resources and on spurious log messages.
val submissionSupervisor = if (startSubmissionMonitor) {
system.actorOf(
SubmissionSupervisor
.props(
executionServiceCluster,
new UncoordinatedDataSourceAccess(slickDataSource),
samDAO,
gcsDAO,
mockNotificationDAO,
gcsDAO.getBucketServiceAccountCredential,
config,
testConf.getDuration("entities.queryTimeout").toScala,
workbenchMetricBaseName
)
.withDispatcher("submission-monitor-dispatcher")
)
} else {
system.actorOf(TestActors.blackholeProps)
}
val submissionSupervisor = system.actorOf(
SubmissionSupervisor
.props(
executionServiceCluster,
new UncoordinatedDataSourceAccess(slickDataSource),
samDAO,
gcsDAO,
mockNotificationDAO,
gcsDAO.getBucketServiceAccountCredential,
config,
testConf.getDuration("entities.queryTimeout").toScala,
workbenchMetricBaseName
)
.withDispatcher("submission-monitor-dispatcher")
)

override val batchUpsertMaxBytes = testConf.getLong("entityUpsert.maxContentSizeBytes")

Expand Down

0 comments on commit 9ca49a8

Please sign in to comment.