From 162f9ad9a1fe7da6dd17b0bb1fc91179f12b9ffc Mon Sep 17 00:00:00 2001 From: Sanjay Vasandani Date: Fri, 24 Jan 2025 08:43:18 -0800 Subject: [PATCH] fix: Run test methods in InProcessLifeOfAReportIntegrationTest (#2005) Closes #2004 --------- Co-authored-by: Tristan Vuong --- .../common/InProcessCmmsComponents.kt | 9 + .../InProcessLifeOfAReportIntegrationTest.kt | 268 ++++++------------ .../reporting/v2/InProcessReportingServer.kt | 41 ++- 3 files changed, 125 insertions(+), 193 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/integration/common/InProcessCmmsComponents.kt b/src/main/kotlin/org/wfanet/measurement/integration/common/InProcessCmmsComponents.kt index f24b5b58ebe..de94a7e4d32 100644 --- a/src/main/kotlin/org/wfanet/measurement/integration/common/InProcessCmmsComponents.kt +++ b/src/main/kotlin/org/wfanet/measurement/integration/common/InProcessCmmsComponents.kt @@ -19,6 +19,7 @@ package org.wfanet.measurement.integration.common import com.google.protobuf.ByteString import com.google.protobuf.TypeRegistry import java.security.cert.X509Certificate +import java.util.concurrent.TimeUnit import kotlinx.coroutines.runBlocking import org.junit.rules.TestRule import org.junit.runner.Description @@ -153,6 +154,8 @@ class InProcessCmmsComponents( } private val publicAccountsClient by lazy { AccountsGrpcKt.AccountsCoroutineStub(kingdom.publicApiChannel) + // Fail faster. + .withDeadlineAfter(5L, TimeUnit.SECONDS) } private val publicApiKeysClient by lazy { ApiKeysGrpcKt.ApiKeysCoroutineStub(kingdom.publicApiChannel) @@ -308,6 +311,12 @@ class InProcessCmmsComponents( populationRequisitionFulfiller.stop() } + fun stopDaemons() { + stopEdpSimulators() + stopDuchyDaemons() + stopPopulationRequisitionFulfillerDaemon() + } + override fun apply(statement: Statement, description: Description): Statement { return ruleChain.apply(statement, description) } diff --git a/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessLifeOfAReportIntegrationTest.kt b/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessLifeOfAReportIntegrationTest.kt index 11c9700aa86..ae968ab2652 100644 --- a/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessLifeOfAReportIntegrationTest.kt +++ b/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessLifeOfAReportIntegrationTest.kt @@ -26,15 +26,12 @@ import com.google.type.interval import com.google.type.timeZone import java.io.File import java.nio.file.Paths -import java.security.SecureRandom import java.time.LocalDate -import kotlin.random.asKotlinRandom import kotlinx.coroutines.Deferred import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking -import org.junit.After import org.junit.BeforeClass import org.junit.Rule import org.junit.Test @@ -73,20 +70,16 @@ import org.wfanet.measurement.integration.common.InProcessDuchy import org.wfanet.measurement.integration.common.SyntheticGenerationSpecs import org.wfanet.measurement.integration.common.reporting.v2.identity.withPrincipalName import org.wfanet.measurement.kingdom.deploy.common.service.DataServices -import org.wfanet.measurement.loadtest.config.VidSampling import org.wfanet.measurement.loadtest.dataprovider.EventQuery import org.wfanet.measurement.loadtest.dataprovider.MeasurementResults -import org.wfanet.measurement.loadtest.dataprovider.SyntheticGeneratorEventQuery import org.wfanet.measurement.loadtest.measurementconsumer.MetadataSyntheticGeneratorEventQuery import org.wfanet.measurement.reporting.deploy.v2.common.server.InternalReportingServer -import org.wfanet.measurement.reporting.service.api.v2alpha.withDefaults import org.wfanet.measurement.reporting.v2alpha.EventGroup import org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub import org.wfanet.measurement.reporting.v2alpha.Metric import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpec import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecKt import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub -import org.wfanet.measurement.reporting.v2alpha.MetricSpec.VidSamplingInterval import org.wfanet.measurement.reporting.v2alpha.MetricSpecKt import org.wfanet.measurement.reporting.v2alpha.MetricsGrpcKt.MetricsCoroutineStub import org.wfanet.measurement.reporting.v2alpha.Report @@ -136,15 +129,17 @@ abstract class InProcessLifeOfAReportIntegrationTest( object : Statement() { override fun evaluate() { inProcessCmmsComponents.startDaemons() - base.evaluate() + try { + base.evaluate() + } finally { + inProcessCmmsComponents.stopDaemons() + } } } } abstract val internalReportingServerServices: InternalReportingServer.Services - private val secureRandom = SecureRandom().asKotlinRandom() - private val reportingServerRule = object : TestRule { lateinit var reportingServer: InProcessReportingServer @@ -191,7 +186,7 @@ abstract class InProcessLifeOfAReportIntegrationTest( return object : Statement() { override fun evaluate() { reportingServer = buildReportingServer() - reportingServer.apply(base, description) + reportingServer.apply(base, description).evaluate() } } } @@ -236,16 +231,6 @@ abstract class InProcessLifeOfAReportIntegrationTest( ReportingSetsCoroutineStub(reportingServer.publicApiChannel) } - @After - fun stopEdpSimulators() { - inProcessCmmsComponents.stopEdpSimulators() - } - - @After - fun stopDuchyDaemons() { - inProcessCmmsComponents.stopDuchyDaemons() - } - @Test fun `reporting set is created and then retrieved`() = runBlocking { val measurementConsumerData = inProcessCmmsComponents.getMeasurementConsumerData() @@ -327,12 +312,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -446,12 +429,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "unique reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -554,12 +535,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "intersection reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -628,12 +607,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -710,12 +687,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -784,12 +759,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } metricFrequencySpec = MetricCalculationSpecKt.metricFrequencySpec { daily = MetricCalculationSpec.MetricFrequencySpec.Daily.getDefaultInstance() @@ -877,12 +850,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } metricFrequencySpec = MetricCalculationSpecKt.metricFrequencySpec { weekly = @@ -920,7 +891,7 @@ abstract class InProcessLifeOfAReportIntegrationTest( reportEnd = date { year = 2024 month = 1 - day = 18 + day = 17 } } } @@ -951,7 +922,7 @@ abstract class InProcessLifeOfAReportIntegrationTest( seconds = 1704268800 // January 3, 2024 at 12:00 AM, America/Los_Angeles } endTime = timestamp { - seconds - 1704873600 // January 10, 2024 at 12:00 AM, America/Los_Angeles + seconds = 1704873600 // January 10, 2024 at 12:00 AM, America/Los_Angeles } } ) @@ -990,12 +961,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "union reach" - metricSpecs += - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } groupings += MetricCalculationSpecKt.grouping { predicates += grouping1Predicate1 @@ -1058,8 +1027,8 @@ abstract class InProcessLifeOfAReportIntegrationTest( } @Test - fun `creating 25 reports at once succeeds`() = runBlocking { - val numReports = 25 + fun `creating 3 reports at once succeeds`() = runBlocking { + val numReports = 3 val measurementConsumerData = inProcessCmmsComponents.getMeasurementConsumerData() val eventGroups = listEventGroups() val eventGroupEntries: List> = @@ -1075,14 +1044,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( parent = measurementConsumerData.name metricCalculationSpec = metricCalculationSpec { displayName = "load test" - metricSpecs += - metricSpec { - reach = - MetricSpecKt.reachParams { - privacyParams = MetricSpecKt.differentialPrivacyParams {} - } - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpecs += metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } metricCalculationSpecId = "fed" } @@ -1160,12 +1125,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpec = metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } val createdMetric = @@ -1208,23 +1171,21 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - reach = - MetricSpecKt.reachParams { - multipleDataProviderParams = - MetricSpecKt.samplingAndPrivacyParams { - privacyParams = DP_PARAMS - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - singleDataProviderParams = - MetricSpecKt.samplingAndPrivacyParams { - privacyParams = SINGLE_DATA_PROVIDER_DP_PARAMS - vidSamplingInterval = SINGLE_DATA_PROVIDER_VID_SAMPLING_INTERVAL - } + metricSpec = metricSpec { + reach = + MetricSpecKt.reachParams { + multipleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = DP_PARAMS + vidSamplingInterval = VID_SAMPLING_INTERVAL + } + singleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = SINGLE_DATA_PROVIDER_DP_PARAMS + vidSamplingInterval = SINGLE_DATA_PROVIDER_VID_SAMPLING_INTERVAL } } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + } } val createdMetric = @@ -1267,17 +1228,15 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - reachAndFrequency = - MetricSpecKt.reachAndFrequencyParams { - reachPrivacyParams = DP_PARAMS - frequencyPrivacyParams = DP_PARAMS - maximumFrequency = 5 - } - vidSamplingInterval = VID_SAMPLING_INTERVAL + metricSpec = metricSpec { + reachAndFrequency = + MetricSpecKt.reachAndFrequencyParams { + reachPrivacyParams = DP_PARAMS + frequencyPrivacyParams = DP_PARAMS + maximumFrequency = 5 } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } val createdMetric = @@ -1344,12 +1303,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - impressionCount = MetricSpecKt.impressionCountParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpec = metricSpec { + impressionCount = MetricSpecKt.impressionCountParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } val createdMetric = @@ -1373,7 +1330,7 @@ abstract class InProcessLifeOfAReportIntegrationTest( val expectedResult = calculateExpectedImpressionMeasurementResult( eventGroupSpecs, - metric.metricSpec.impressionCount.maximumFrequencyPerUser, + createdMetric.metricSpec.impressionCount.maximumFrequencyPerUser, ) val impressionResult = retrievedMetric.result.impressionCount @@ -1402,12 +1359,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - watchDuration = MetricSpecKt.watchDurationParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpec = metricSpec { + watchDuration = MetricSpecKt.watchDurationParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } val createdMetric = @@ -1440,12 +1395,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( val metric = metric { reportingSet = createdPrimitiveReportingSet.name timeInterval = EVENT_RANGE.toInterval() - metricSpec = - metricSpec { - reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } - vidSamplingInterval = VID_SAMPLING_INTERVAL - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpec = metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } filters += "person.gender == ${Person.Gender.MALE_VALUE}" } @@ -1479,8 +1432,8 @@ abstract class InProcessLifeOfAReportIntegrationTest( } @Test - fun `creating 25 metrics at once succeeds`() = runBlocking { - val numMetrics = 25 + fun `creating 3 metrics at once succeeds`() = runBlocking { + val numMetrics = 3 val measurementConsumerData = inProcessCmmsComponents.getMeasurementConsumerData() val eventGroups = listEventGroups() val eventGroupEntries: List> = @@ -1494,12 +1447,10 @@ abstract class InProcessLifeOfAReportIntegrationTest( startTime = timestamp { seconds = 100 } endTime = timestamp { seconds = 200 } } - metricSpec = - metricSpec { - reach = - MetricSpecKt.reachParams { privacyParams = MetricSpecKt.differentialPrivacyParams {} } - } - .withDefaults(reportingServer.metricSpecConfig, secureRandom) + metricSpec = metricSpec { + reach = MetricSpecKt.reachParams { privacyParams = DP_PARAMS } + vidSamplingInterval = VID_SAMPLING_INTERVAL + } } val deferred: MutableList> = mutableListOf() @@ -1799,45 +1750,6 @@ abstract class InProcessLifeOfAReportIntegrationTest( ) } - private fun SyntheticGeneratorEventQuery.getUserVirtualIds( - eventGroup: EventGroup, - filter: String, - collectionInterval: Interval, - ): Sequence { - val cmmsMetadata = - CmmsEventGroupKt.metadata { - eventGroupMetadataDescriptor = eventGroup.metadata.eventGroupMetadataDescriptor - metadata = eventGroup.metadata.metadata - } - val encryptedCmmsMetadata = - encryptMetadata(cmmsMetadata, InProcessCmmsComponents.MC_ENTITY_CONTENT.encryptionPublicKey) - val cmmsEventGroup = cmmsEventGroup { encryptedMetadata = encryptedCmmsMetadata } - - val eventFilter = RequisitionSpecKt.eventFilter { expression = filter } - - return this.getUserVirtualIds( - EventQuery.EventGroupSpec( - cmmsEventGroup, - RequisitionSpecKt.EventGroupEntryKt.value { - this.collectionInterval = collectionInterval - this.filter = eventFilter - }, - ) - ) - } - - private fun Sequence.calculateSampledVids( - vidSamplingInterval: VidSamplingInterval - ): Sequence { - return this.filter { vid -> - VidSampling.sampler.vidIsInSamplingBucket( - vid, - vidSamplingInterval.start, - vidSamplingInterval.width, - ) - } - } - /** Computes the margin of error, i.e. half width, of a 99.9% confidence interval. */ private fun computeErrorMargin(standardDeviation: Double): Double { return CONFIDENCE_INTERVAL_MULTIPLIER * standardDeviation diff --git a/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessReportingServer.kt b/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessReportingServer.kt index 674c9ef0f86..8ae8a79ccf3 100644 --- a/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessReportingServer.kt +++ b/src/main/kotlin/org/wfanet/measurement/integration/common/reporting/v2/InProcessReportingServer.kt @@ -46,6 +46,7 @@ import org.wfanet.measurement.common.crypto.tink.loadPrivateKey import org.wfanet.measurement.common.grpc.testing.GrpcTestServerRule import org.wfanet.measurement.common.grpc.withVerboseLogging import org.wfanet.measurement.common.readByteString +import org.wfanet.measurement.common.testing.CloseableResource import org.wfanet.measurement.common.testing.chainRulesSequentially import org.wfanet.measurement.config.reporting.EncryptionKeyPairConfig import org.wfanet.measurement.config.reporting.MeasurementConsumerConfig @@ -80,7 +81,7 @@ import org.wfanet.measurement.reporting.v2alpha.MetricsGrpcKt.MetricsCoroutineSt /** TestRule that starts and stops all Reporting Server gRPC services. */ class InProcessReportingServer( private val internalReportingServerServices: InternalReportingServer.Services, - private val kingdomPublicApiChannel: Channel, + kingdomPublicApiChannel: Channel, private val encryptionKeyPairConfig: EncryptionKeyPairConfig, private val signingPrivateKeyDir: File, private val measurementConsumerConfig: MeasurementConsumerConfig, @@ -129,6 +130,22 @@ class InProcessReportingServer( lateinit var metricSpecConfig: MetricSpecConfig + private val celEnvCacheProvider = + object : + CloseableResource({ + CelEnvCacheProvider( + publicKingdomEventGroupMetadataDescriptorsClient.withAuthenticationKey( + measurementConsumerConfig.apiKey + ), + EventGroup.getDescriptor(), + Duration.ofSeconds(5), + knownEventGroupMetadataTypes, + ) + }) { + val value: CelEnvCacheProvider + get() = resource + } + private fun createPublicApiTestServerRule(): GrpcTestServerRule = GrpcTestServerRule(logAllRequests = verboseGrpcLogging) { runBlocking { @@ -175,16 +192,6 @@ class InProcessReportingServer( } } - val celEnvCacheProvider = - CelEnvCacheProvider( - publicKingdomEventGroupMetadataDescriptorsClient.withAuthenticationKey( - measurementConsumerConfig.apiKey - ), - EventGroup.getDescriptor(), - Duration.ofSeconds(5), - knownEventGroupMetadataTypes, - ) - METRIC_SPEC_CONFIG.validate() metricSpecConfig = METRIC_SPEC_CONFIG @@ -196,7 +203,7 @@ class InProcessReportingServer( EventGroupsService( publicKingdomEventGroupsClient, encryptionKeyPairStore, - celEnvCacheProvider, + celEnvCacheProvider.value, ) .withMetadataPrincipalIdentities(measurementConsumerConfigs), MetricCalculationSpecsService( @@ -246,10 +253,10 @@ class InProcessReportingServer( val publicApiChannel: Channel get() = publicApiServer.channel - override fun apply(statement: Statement, description: Description): Statement { + override fun apply(base: Statement, description: Description): Statement { publicApiServer = createPublicApiTestServerRule() - return chainRulesSequentially(internalReportingServer, publicApiServer) - .apply(statement, description) + return chainRulesSequentially(internalReportingServer, celEnvCacheProvider, publicApiServer) + .apply(base, description) } companion object { @@ -275,6 +282,7 @@ class InProcessReportingServer( } } } + singleDataProviderParams = multipleDataProviderParams } reachAndFrequencyParams = @@ -300,6 +308,7 @@ class InProcessReportingServer( } } } + singleDataProviderParams = multipleDataProviderParams maximumFrequency = 10 } @@ -344,6 +353,8 @@ class InProcessReportingServer( } maximumWatchDurationPerUser = Durations.fromSeconds(4000) } + + populationCountParams = MetricSpecConfig.PopulationCountParams.getDefaultInstance() } } }