gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitae905f15ae905f15Merge t36a: tracker#36 apply rechecks, reportmreae905f15/tests/photoqueue.hl

1.6 KB

  1. // tests/photoqueue.hl — mission 046: the sliced photo queue (people.hl photoQueueStart/Step) must equal the former one-shot photoQueue
  2. // (inlined below, verbatim) — same ids, same order. On a store copy (app stopped). TRACKER_PHOTOQ_MARK=1 first marks every 3rd person
  3. // (photoCheck) and every 5th (tmdbProfile) so the predicate has both outcomes; TRACKER_SLICE_MS=0 forces many ticks.
  4. import { env } from 'hl:proc'
  5. import { now } from 'hl:time'
  6. import { personsTable } from '../lib/shows.hl'
  7. import { peopleView, peopleViewCurrent, needsPhoto, photoQueueStart, photoQueueStep } from '../lib/people.hl'
  8. oldQueue = () => {
  9. peopleViewCurrent()
  10. out = []
  11. for (id of peopleView.ids) {
  12. let p = personsTable.fetch(id)
  13. if (p != null && needsPhoto(&p)) { out.push(id) }
  14. }
  15. return out
  16. }
  17. if (env('TRACKER_PHOTOQ_MARK') == '1') {
  18. i = 0
  19. for (p of personsTable.find(null, null)) {
  20. x = p
  21. if (i % 3 == 0) { x.photoCheck = 'TMDB has none' } else if (i % 5 == 0) { x.tmdbProfile = '/x.jpg' }
  22. personsTable.update(x.id, x)
  23. i = i + 1
  24. }
  25. }
  26. t0 = now()
  27. a = env('TRACKER_PHOTOQ_NOOLD') == '1' ? [] : oldQueue()
  28. t1 = now()
  29. c = photoQueueStart()
  30. maxTick = 0
  31. while (true) {
  32. s = now()
  33. done = photoQueueStep(&c)
  34. d = now() - s
  35. if (d > maxTick) { maxTick = d }
  36. if (done) { break }
  37. }
  38. b = c.out
  39. console.log('new queue built: ' + b.length)
  40. same = a.length == b.length
  41. i = 0
  42. while (same && i < a.length) { if (a[i] != b[i]) { same = false } i = i + 1 }
  43. 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)
  44. console.log(same ? 'SAME ORDER AND IDS' : 'DIFFERENT')

Branches

Latest commits

  • ae905f15Merge t36a: tracker#36 apply rechecks, reportmre
  • 796bfaceT36A: report validated fixes, failed live SSH check and verified rollbackmre
  • 55257852log: #53 live, #56 mergedmre
  • 78b39f1bMerge hm56-rows: tracker#56 list builders insert oncemre
  • 7aea52batmdb fix: protect owners without slugs and record passing gatesmre
  • 9b3c2559tmdb fix: revalidate planned identities and reserve target idsmre
  • 6da612fclog: T36A tool defectmre
  • d56ee0daT36A: report unsafe TMDB apply revalidation and stop before livemre
  • 08e55255log: HM56 done, T36A startedmre
  • 91bcdf0eAvoid per-row list copies and reproduce keyed-row blockersmre
  • 5fd2ac75status: #36 GOmre
  • 0d253b45mission: T36Amre
  • 2aa22d23log: #36 GOmre
  • 833aee2flog: #50 closed, HM56 startedmre
  • ac58c1e5mission: HM56mre
  • 58979c0clog: HM54 held for decision, DP65 startedmre
  • bb2ebc67log: #64 live, #53 mergedmre
  • 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre
  • 2156cc7flog: HM54 reviewmre
  • 9fb82efclog: HM54 gap, fill continuesmre