mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-15 07:28:30 +00:00
fixup! Fix bug in job eligibility sorting after a job deletion.
This commit is contained in:
committed by
jeffrey-signal
parent
ba63a5255d
commit
c8b7bc2f5b
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user