tracker
All repositories: gitoria
1.6 KB
// tests/photoqueue.hl — mission 046: the sliced photo queue (people.hl photoQueueStart/Step) must equal the former one-shot photoQueue// (inlined below, verbatim) — same ids, same order. On a store copy (app stopped). TRACKER_PHOTOQ_MARK=1 first marks every 3rd person// (photoCheck) and every 5th (tmdbProfile) so the predicate has both outcomes; TRACKER_SLICE_MS=0 forces many ticks.import { env } from 'hl:proc'import { now } from 'hl:time'import { personsTable } from '../lib/shows.hl'import { peopleView, peopleViewCurrent, needsPhoto, photoQueueStart, photoQueueStep } from '../lib/people.hl'oldQueue = () => {peopleViewCurrent()out = []for (id of peopleView.ids) {let p = personsTable.fetch(id)if (p != null && needsPhoto(&p)) { out.push(id) }}return out}if (env('TRACKER_PHOTOQ_MARK') == '1') {i = 0for (p of personsTable.find(null, null)) {x = pif (i % 3 == 0) { x.photoCheck = 'TMDB has none' } else if (i % 5 == 0) { x.tmdbProfile = '/x.jpg' }personsTable.update(x.id, x)i = i + 1}}t0 = now()a = env('TRACKER_PHOTOQ_NOOLD') == '1' ? [] : oldQueue()t1 = now()c = photoQueueStart()maxTick = 0while (true) {s = now()done = photoQueueStep(&c)d = now() - sif (d > maxTick) { maxTick = d }if (done) { break }}b = c.outconsole.log('new queue built: ' + b.length)same = a.length == b.lengthi = 0while (same && i < a.length) { if (a[i] != b[i]) { same = false } i = i + 1 }console.log('people ' + peopleView.ids.length + ' old=' + a.length + ' (' + (t1 - t0) + ' ms one block) new=' + b.length + ' ticks=' + c.steps + ' skipped=' + c.skipped + ' scanMs=' + c.ms + ' maxTickMs=' + maxTick)console.log(same ? 'SAME ORDER AND IDS' : 'DIFFERENT')
Branches
Latest commits
- 9fb82efclog: HM54 gap, fill continuesmre
- b632eb8dlog: HM53 done, HM54 startedmre
- 3356fcfclog: #52 blocked, HM53 startedmre
- 833dcfc9Merge hm52-search: report only, tracker#52 blocked by framework gapmre
- 73010cc0HM52: report replace-navigation search draft regressionmre
- 1742e92bstatus: DP64 and HM52 runningmre
- 29ad5b58log: #64 merged, DP64 and HM52 startedmre
- fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
- b2e2206dlog: #63 livemre
- 5831e0e0log: HM64 donemre
- 4042b923Flatten catalog membership rows into paired slotsmre
- ea8a759elog: #61 #62 live, DP63 and HM64 startedmre
- 40439456Merge hm63-searchtext: tracker#63 packed search textmre
- b7e6b48ePack normalized search text behind numeric offsetsmre
- b35f53e1log: DP62 stale runtime decisionmre
- f9593602log: Apollo deploy rule correctionmre
- 3c95f7f3log: DP62 and HM63 startedmre
- 9c4397c9mission HM63mre
- 8dfe42c8mission DP62mre
- e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre