fixup! Fix bug in job eligibility sorting after a job deletion.

This commit is contained in:
Greyson Parrelli
2025-12-02 16:55:30 -05:00
committed by jeffrey-signal
parent ba63a5255d
commit c8b7bc2f5b

View File

@@ -89,27 +89,6 @@ class FastJobStorageTest {
assertThat(subject.getNextEligibleJob(10, NO_PREDICATE)).isEqualTo(fullSpec.jobSpec)
}
@Test
fun `insertJobs - depends on memory-only job that does not exist`() {
val database = mockDatabase()
val subject = FastJobStorage(database)
val dependsOnFullSpec = fullSpec("j1", "f1", isMemoryOnly = true)
val job = jobSpec("j2", "f2", isMemoryOnly = false)
val dependencySpec = DependencySpec(jobId = "j2", dependsOnJobId = dependsOnFullSpec.jobSpec.id, isMemoryOnly = true)
val fullSpec = FullSpec(jobSpec = job, constraintSpecs = emptyList(), dependencySpecs = listOf(dependencySpec))
val fullSpecList = listOf(fullSpec)
subject.insertJobs(fullSpecList)
verify(exactly = 1) { database.insertJobs(fullSpecList) }
assertThat(subject.getNextEligibleJob(10, NO_PREDICATE)).isEqualTo(dependsOnFullSpec.jobSpec)
subject.deleteJob(dependsOnFullSpec.jobSpec.id)
assertThat(subject.getNextEligibleJob(10, NO_PREDICATE)).isEqualTo(fullSpec.jobSpec)
}
@Test
fun `insertJobs - data can be found`() {
val subject = FastJobStorage(mockDatabase())