gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6b58571e6b58571elog: GC windowmre6b58571e/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

  • 6b58571elog: GC windowmre
  • 5c8baa1fdeploy lock: hold only around deploy.shmre
  • b8dac822log: hybriel#309mre
  • bf676d9elog: GC1 startedmre
  • c7828541mission GC1mre
  • ef949994conductor: neutral ticket rulemre
  • 89e91ef3log: RV39 livemre
  • ee2b677alog: RV39 deployingmre
  • c1c4178cMerge branch 'rv39'mre
  • a016e9abReapply "Merge branch 'rv39'"mre
  • f29e2502log: RV39 gate fixmre
  • d9fce111browser gate #26: exact frame count incl. SL1 people step (hybriel#308)mre
  • ad529ac1log: m572 verdictmre
  • 1b37d404RV39 on hold: hybriel#308mre
  • f9127c68Revert "Merge branch 'rv39'"mre
  • cd39f3d3log: hybriel#308mre
  • 51341d6elog: RV39 deploy startedmre
  • c9e29e06Merge branch 'rv39'mre
  • 0f8d1fdclog: RV39 report, browser 387/2mre
  • 50249b0bRV39: reportmre