diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-21 17:00:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-21 17:00:09 +0200 |
| commit | 10dfc257de65cbbd1e25d1d7f5833bfb687d85ed (patch) | |
| tree | 48b102c4d45b366abd8d0d368c31d6c0596ac30f /simulator/opendc-serverless/opendc-serverless-simulator | |
| parent | b4d1289bbd9539c041e8aeb39bb8962628399809 (diff) | |
| parent | 62678b2890a7f3640836b99ca2fec9efd7485929 (diff) | |
simulator: Introduce SimulationCoroutineDispatcher (#120)
This change introduces the SimulationCoroutineDispatcher implementation which replaces the TestCoroutineDispatcher for running single-threaded simulations.
Diffstat (limited to 'simulator/opendc-serverless/opendc-serverless-simulator')
| -rw-r--r-- | simulator/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/simulator/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt b/simulator/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt index 3a070475..9592d870 100644 --- a/simulator/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt +++ b/simulator/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt @@ -27,7 +27,6 @@ import io.mockk.spyk import io.opentelemetry.api.metrics.MeterProvider import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay -import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.yield import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -42,7 +41,7 @@ import org.opendc.simulator.compute.model.ProcessingNode import org.opendc.simulator.compute.model.ProcessingUnit import org.opendc.simulator.compute.workload.SimFlopsWorkload import org.opendc.simulator.compute.workload.SimWorkload -import org.opendc.simulator.utils.DelayControllerClockAdapter +import org.opendc.simulator.core.runBlockingSimulation /** * A test suite for the [ServerlessService] implementation under simulated conditions. @@ -63,9 +62,8 @@ internal class SimServerlessServiceTest { } @Test - fun testSmoke() = runBlockingTest { + fun testSmoke() = runBlockingSimulation { val meter = MeterProvider.noop().get("opendc-serverless") - val clock = DelayControllerClockAdapter(this) val workload = spyk(object : SimServerlessWorkload, SimWorkload by SimFlopsWorkload(1000) { override suspend fun invoke() {} }) |
