Skip to content

Commit

Permalink
Merge branch 'develop' into fix/fix-scheduling-versioning-migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
dandelany authored Mar 28, 2024
2 parents 0d8da1f + 53643b3 commit 27de721
Show file tree
Hide file tree
Showing 115 changed files with 652 additions and 293 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ configure(subprojects.findAll { it.projectDir.toPath().resolve('sql').toFile().e

// Remove distributed SQL as part of `clean` task
task undoDistributeSql(type: Delete) {
doLast { // Explicity do last to avoid running during configuration step
doLast { // Explicitly do last to avoid running during configuration step
file("${sp.projectDir}/sql").list().each {
delete "$rootDir/deployment/postgres-init-db/sql/$it"
}
Expand Down
3 changes: 3 additions & 0 deletions constraints/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions contrib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions db-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jacocoTestReport {

task e2eTest(type: Test) {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

dependencies {
Expand Down
6 changes: 5 additions & 1 deletion e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ task e2eTest(type: Test) {
// Run the tests in parallel to improve performance
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}

dependencies {
testImplementation project(":timeline")
testImplementation project(":procedural:timeline")
testImplementation "com.zaxxer:HikariCP:5.1.0"
testImplementation("org.postgresql:postgresql:42.6.0")
testImplementation project(':merlin-driver')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ void beforeEach() throws IOException, InterruptedException {
// Insert the Plan
fooPlan = hasura.createPlan(
fooId,
"Foo Plan - Simulation Tests",
"Foo Plan - Scheduling Tests",
"720:00:00",
planStartTimestamp);

Expand Down
3 changes: 3 additions & 0 deletions examples/banananation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ java {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/config-with-defaults/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/config-without-defaults/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/foo-missionmodel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/minimal-mission-model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions examples/streamline-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jar {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
3 changes: 3 additions & 0 deletions merlin-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ test {
useJUnitPlatform {
includeEngines 'jqwik', 'junit-jupiter'
}
testLogging {
exceptionFormat = 'full'
}
}

jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ void simulateTask(final MissionModel<Model> missionModel, final TaskFactory<Retu
}

// Schedule all activities.
final var taskId = engine.scheduleTask(elapsedTime, task);
final var spanId = engine.scheduleTask(elapsedTime, task);

// Drive the engine until we're out of time.
// TERMINATION: Actually, we might never break if real time never progresses forward.
while (!engine.isTaskComplete(taskId)) {
while (!engine.getSpan(spanId).isComplete()) {
final var batch = engine.extractNextJobs(Duration.MAX_VALUE);

// Increment real time, if necessary.
Expand Down Expand Up @@ -233,9 +233,11 @@ private static <Model, Output> TaskFactory<Unit> makeTaskFactory(
{
// Emit the current activity (defined by directiveId)
return executor -> scheduler0 -> TaskStatus.calling((TaskFactory<Output>) (executor1 -> scheduler1 -> {
scheduler1.pushSpan();
scheduler1.emit(directiveId, activityTopic);
return task.create(executor1).step(scheduler1);
}), scheduler2 -> {
scheduler2.popSpan();
// When the current activity finishes, get the list of the activities that needed this activity to finish to know their start time
final List<Pair<ActivityDirectiveId, Duration>> dependents = resolved.get(directiveId) == null ? List.of() : resolved.get(directiveId);
// Iterate over the dependents
Expand Down

This file was deleted.

Loading

0 comments on commit 27de721

Please sign in to comment.