@onekeyfe/react-native-range-downloader 3.0.157-alpha.253 → 3.0.157-alpha.255
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -286,8 +286,8 @@ class SegmentArtifactSweepTest {
|
|
|
286
286
|
assertEquals(listOf(10, 25, 50, 100), emitted)
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
// Under genuine concurrency the CAS gate
|
|
290
|
-
//
|
|
289
|
+
// Under genuine concurrency the CAS gate never decreases the published max
|
|
290
|
+
// and accepts each percentage at most once. Many threads race the
|
|
291
291
|
// same gate driven by the REAL progressPercent + AtomicInteger CAS.
|
|
292
292
|
@Test
|
|
293
293
|
fun progressGateNeverGoesBackwardUnderConcurrency() {
|
|
@@ -328,11 +328,10 @@ class SegmentArtifactSweepTest {
|
|
|
328
328
|
// The published max ends at exactly 100 and never regressed.
|
|
329
329
|
assertEquals("gate must settle at 100%", 100, last.get())
|
|
330
330
|
assertEquals("published max must never regress", 0, regress.get())
|
|
331
|
-
// Each
|
|
332
|
-
//
|
|
331
|
+
// Each successful CAS is unique. Queue insertion happens after CAS, so
|
|
332
|
+
// concurrent threads can append those values in a different order.
|
|
333
333
|
val list = emissions.toList()
|
|
334
334
|
assertEquals("every emission must be unique (no re-emit of an equal value)", list.toSet().size, list.size)
|
|
335
|
-
assertEquals("emissions must be monotone non-decreasing", list.sorted(), list)
|
|
336
335
|
assertTrue("the terminal 100% must be emitted exactly once", list.count { it == 100 } == 1)
|
|
337
336
|
}
|
|
338
337
|
|
package/package.json
CHANGED