persistence_spec_test.json 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  1. {
  2. "Local mutations are persisted and re-sent": {
  3. "describeName": "Persistence:",
  4. "itName": "Local mutations are persisted and re-sent",
  5. "tags": [
  6. "durable-persistence"
  7. ],
  8. "config": {
  9. "useGarbageCollection": true,
  10. "numClients": 1
  11. },
  12. "steps": [
  13. {
  14. "userSet": [
  15. "collection/key1",
  16. {
  17. "foo": "bar"
  18. }
  19. ]
  20. },
  21. {
  22. "userSet": [
  23. "collection/key2",
  24. {
  25. "baz": "quu"
  26. }
  27. ]
  28. },
  29. {
  30. "restart": true,
  31. "stateExpect": {
  32. "activeTargets": {},
  33. "limboDocs": [],
  34. "numOutstandingWrites": 2
  35. }
  36. },
  37. {
  38. "writeAck": {
  39. "version": 1
  40. }
  41. },
  42. {
  43. "writeAck": {
  44. "version": 2
  45. },
  46. "stateExpect": {
  47. "numOutstandingWrites": 0
  48. }
  49. }
  50. ]
  51. },
  52. "Persisted local mutations are visible to listeners": {
  53. "describeName": "Persistence:",
  54. "itName": "Persisted local mutations are visible to listeners",
  55. "tags": [
  56. "durable-persistence"
  57. ],
  58. "config": {
  59. "useGarbageCollection": true,
  60. "numClients": 1
  61. },
  62. "steps": [
  63. {
  64. "userSet": [
  65. "collection/key1",
  66. {
  67. "foo": "bar"
  68. }
  69. ]
  70. },
  71. {
  72. "userSet": [
  73. "collection/key2",
  74. {
  75. "baz": "quu"
  76. }
  77. ]
  78. },
  79. {
  80. "restart": true,
  81. "stateExpect": {
  82. "activeTargets": {},
  83. "limboDocs": []
  84. }
  85. },
  86. {
  87. "userListen": [
  88. 2,
  89. {
  90. "path": "collection",
  91. "filters": [],
  92. "orderBys": []
  93. }
  94. ],
  95. "stateExpect": {
  96. "activeTargets": {
  97. "2": {
  98. "query": {
  99. "path": "collection",
  100. "filters": [],
  101. "orderBys": []
  102. },
  103. "resumeToken": ""
  104. }
  105. }
  106. },
  107. "expect": [
  108. {
  109. "query": {
  110. "path": "collection",
  111. "filters": [],
  112. "orderBys": []
  113. },
  114. "added": [
  115. {
  116. "key": "collection/key1",
  117. "version": 0,
  118. "value": {
  119. "foo": "bar"
  120. },
  121. "options": {
  122. "hasLocalMutations": true,
  123. "hasCommittedMutations": false
  124. }
  125. },
  126. {
  127. "key": "collection/key2",
  128. "version": 0,
  129. "value": {
  130. "baz": "quu"
  131. },
  132. "options": {
  133. "hasLocalMutations": true,
  134. "hasCommittedMutations": false
  135. }
  136. }
  137. ],
  138. "errorCode": 0,
  139. "fromCache": true,
  140. "hasPendingWrites": true
  141. }
  142. ]
  143. }
  144. ]
  145. },
  146. "Remote documents are persisted": {
  147. "describeName": "Persistence:",
  148. "itName": "Remote documents are persisted",
  149. "tags": [
  150. "durable-persistence"
  151. ],
  152. "config": {
  153. "useGarbageCollection": true,
  154. "numClients": 1
  155. },
  156. "steps": [
  157. {
  158. "userListen": [
  159. 2,
  160. {
  161. "path": "collection",
  162. "filters": [],
  163. "orderBys": []
  164. }
  165. ],
  166. "stateExpect": {
  167. "activeTargets": {
  168. "2": {
  169. "query": {
  170. "path": "collection",
  171. "filters": [],
  172. "orderBys": []
  173. },
  174. "resumeToken": ""
  175. }
  176. }
  177. }
  178. },
  179. {
  180. "watchAck": [
  181. 2
  182. ]
  183. },
  184. {
  185. "watchEntity": {
  186. "docs": [
  187. {
  188. "key": "collection/key",
  189. "version": 1000,
  190. "value": {
  191. "foo": "bar"
  192. },
  193. "options": {
  194. "hasLocalMutations": false,
  195. "hasCommittedMutations": false
  196. }
  197. }
  198. ],
  199. "targets": [
  200. 2
  201. ]
  202. }
  203. },
  204. {
  205. "watchCurrent": [
  206. [
  207. 2
  208. ],
  209. "resume-token-1000"
  210. ]
  211. },
  212. {
  213. "watchSnapshot": {
  214. "version": 1000,
  215. "targetIds": []
  216. },
  217. "expect": [
  218. {
  219. "query": {
  220. "path": "collection",
  221. "filters": [],
  222. "orderBys": []
  223. },
  224. "added": [
  225. {
  226. "key": "collection/key",
  227. "version": 1000,
  228. "value": {
  229. "foo": "bar"
  230. },
  231. "options": {
  232. "hasLocalMutations": false,
  233. "hasCommittedMutations": false
  234. }
  235. }
  236. ],
  237. "errorCode": 0,
  238. "fromCache": false,
  239. "hasPendingWrites": false
  240. }
  241. ]
  242. },
  243. {
  244. "restart": true,
  245. "stateExpect": {
  246. "activeTargets": {},
  247. "limboDocs": []
  248. }
  249. },
  250. {
  251. "userListen": [
  252. 2,
  253. {
  254. "path": "collection",
  255. "filters": [],
  256. "orderBys": []
  257. }
  258. ],
  259. "stateExpect": {
  260. "activeTargets": {
  261. "2": {
  262. "query": {
  263. "path": "collection",
  264. "filters": [],
  265. "orderBys": []
  266. },
  267. "resumeToken": "resume-token-1000"
  268. }
  269. }
  270. },
  271. "expect": [
  272. {
  273. "query": {
  274. "path": "collection",
  275. "filters": [],
  276. "orderBys": []
  277. },
  278. "added": [
  279. {
  280. "key": "collection/key",
  281. "version": 1000,
  282. "value": {
  283. "foo": "bar"
  284. },
  285. "options": {
  286. "hasLocalMutations": false,
  287. "hasCommittedMutations": false
  288. }
  289. }
  290. ],
  291. "errorCode": 0,
  292. "fromCache": true,
  293. "hasPendingWrites": false
  294. }
  295. ]
  296. }
  297. ]
  298. },
  299. "Remote documents from watch are not GC'd": {
  300. "describeName": "Persistence:",
  301. "itName": "Remote documents from watch are not GC'd",
  302. "tags": [],
  303. "config": {
  304. "useGarbageCollection": false,
  305. "numClients": 1
  306. },
  307. "steps": [
  308. {
  309. "userListen": [
  310. 2,
  311. {
  312. "path": "collection",
  313. "filters": [],
  314. "orderBys": []
  315. }
  316. ],
  317. "stateExpect": {
  318. "activeTargets": {
  319. "2": {
  320. "query": {
  321. "path": "collection",
  322. "filters": [],
  323. "orderBys": []
  324. },
  325. "resumeToken": ""
  326. }
  327. }
  328. }
  329. },
  330. {
  331. "watchAck": [
  332. 2
  333. ]
  334. },
  335. {
  336. "watchEntity": {
  337. "docs": [
  338. {
  339. "key": "collection/key",
  340. "version": 1000,
  341. "value": {
  342. "foo": "bar"
  343. },
  344. "options": {
  345. "hasLocalMutations": false,
  346. "hasCommittedMutations": false
  347. }
  348. }
  349. ],
  350. "targets": [
  351. 2
  352. ]
  353. }
  354. },
  355. {
  356. "watchCurrent": [
  357. [
  358. 2
  359. ],
  360. "resume-token-1000"
  361. ]
  362. },
  363. {
  364. "watchSnapshot": {
  365. "version": 1000,
  366. "targetIds": []
  367. },
  368. "expect": [
  369. {
  370. "query": {
  371. "path": "collection",
  372. "filters": [],
  373. "orderBys": []
  374. },
  375. "added": [
  376. {
  377. "key": "collection/key",
  378. "version": 1000,
  379. "value": {
  380. "foo": "bar"
  381. },
  382. "options": {
  383. "hasLocalMutations": false,
  384. "hasCommittedMutations": false
  385. }
  386. }
  387. ],
  388. "errorCode": 0,
  389. "fromCache": false,
  390. "hasPendingWrites": false
  391. }
  392. ]
  393. },
  394. {
  395. "userUnlisten": [
  396. 2,
  397. {
  398. "path": "collection",
  399. "filters": [],
  400. "orderBys": []
  401. }
  402. ],
  403. "stateExpect": {
  404. "activeTargets": {}
  405. }
  406. },
  407. {
  408. "userListen": [
  409. 2,
  410. {
  411. "path": "collection",
  412. "filters": [],
  413. "orderBys": []
  414. }
  415. ],
  416. "stateExpect": {
  417. "activeTargets": {
  418. "2": {
  419. "query": {
  420. "path": "collection",
  421. "filters": [],
  422. "orderBys": []
  423. },
  424. "resumeToken": "resume-token-1000"
  425. }
  426. }
  427. },
  428. "expect": [
  429. {
  430. "query": {
  431. "path": "collection",
  432. "filters": [],
  433. "orderBys": []
  434. },
  435. "added": [
  436. {
  437. "key": "collection/key",
  438. "version": 1000,
  439. "value": {
  440. "foo": "bar"
  441. },
  442. "options": {
  443. "hasLocalMutations": false,
  444. "hasCommittedMutations": false
  445. }
  446. }
  447. ],
  448. "errorCode": 0,
  449. "fromCache": true,
  450. "hasPendingWrites": false
  451. }
  452. ]
  453. }
  454. ]
  455. },
  456. "Remote documents from user sets are not GC'd": {
  457. "describeName": "Persistence:",
  458. "itName": "Remote documents from user sets are not GC'd",
  459. "tags": [],
  460. "config": {
  461. "useGarbageCollection": false,
  462. "numClients": 1
  463. },
  464. "steps": [
  465. {
  466. "userSet": [
  467. "collection/key",
  468. {
  469. "foo": "bar"
  470. }
  471. ]
  472. },
  473. {
  474. "writeAck": {
  475. "version": 1000
  476. },
  477. "stateExpect": {
  478. "userCallbacks": {
  479. "acknowledgedDocs": [
  480. "collection/key"
  481. ],
  482. "rejectedDocs": []
  483. }
  484. }
  485. },
  486. {
  487. "userListen": [
  488. 2,
  489. {
  490. "path": "collection",
  491. "filters": [],
  492. "orderBys": []
  493. }
  494. ],
  495. "stateExpect": {
  496. "activeTargets": {
  497. "2": {
  498. "query": {
  499. "path": "collection",
  500. "filters": [],
  501. "orderBys": []
  502. },
  503. "resumeToken": ""
  504. }
  505. }
  506. },
  507. "expect": [
  508. {
  509. "query": {
  510. "path": "collection",
  511. "filters": [],
  512. "orderBys": []
  513. },
  514. "added": [
  515. {
  516. "key": "collection/key",
  517. "version": 1000,
  518. "value": {
  519. "foo": "bar"
  520. },
  521. "options": {
  522. "hasLocalMutations": false,
  523. "hasCommittedMutations": true
  524. }
  525. }
  526. ],
  527. "errorCode": 0,
  528. "fromCache": true,
  529. "hasPendingWrites": false
  530. }
  531. ]
  532. }
  533. ]
  534. },
  535. "Mutation Queue is persisted across uid switches": {
  536. "describeName": "Persistence:",
  537. "itName": "Mutation Queue is persisted across uid switches",
  538. "tags": [],
  539. "config": {
  540. "useGarbageCollection": true,
  541. "numClients": 1
  542. },
  543. "steps": [
  544. {
  545. "userSet": [
  546. "users/anon",
  547. {
  548. "uid": "anon"
  549. }
  550. ]
  551. },
  552. {
  553. "changeUser": "user1",
  554. "stateExpect": {
  555. "numOutstandingWrites": 0
  556. }
  557. },
  558. {
  559. "userSet": [
  560. "users/user1",
  561. {
  562. "uid": "user1"
  563. }
  564. ]
  565. },
  566. {
  567. "userSet": [
  568. "users/user1",
  569. {
  570. "uid": "user1",
  571. "extra": true
  572. }
  573. ]
  574. },
  575. {
  576. "changeUser": null,
  577. "stateExpect": {
  578. "numOutstandingWrites": 1
  579. }
  580. },
  581. {
  582. "writeAck": {
  583. "version": 1000
  584. },
  585. "stateExpect": {
  586. "userCallbacks": {
  587. "acknowledgedDocs": [
  588. "users/anon"
  589. ],
  590. "rejectedDocs": []
  591. }
  592. }
  593. },
  594. {
  595. "changeUser": "user1",
  596. "stateExpect": {
  597. "numOutstandingWrites": 2
  598. }
  599. },
  600. {
  601. "writeAck": {
  602. "version": 2000
  603. },
  604. "stateExpect": {
  605. "userCallbacks": {
  606. "acknowledgedDocs": [
  607. "users/user1"
  608. ],
  609. "rejectedDocs": []
  610. }
  611. }
  612. },
  613. {
  614. "writeAck": {
  615. "version": 3000
  616. },
  617. "stateExpect": {
  618. "userCallbacks": {
  619. "acknowledgedDocs": [
  620. "users/user1"
  621. ],
  622. "rejectedDocs": []
  623. }
  624. }
  625. }
  626. ]
  627. },
  628. "Mutation Queue is persisted across uid switches (with restarts)": {
  629. "describeName": "Persistence:",
  630. "itName": "Mutation Queue is persisted across uid switches (with restarts)",
  631. "tags": [
  632. "durable-persistence"
  633. ],
  634. "config": {
  635. "useGarbageCollection": true,
  636. "numClients": 1
  637. },
  638. "steps": [
  639. {
  640. "userSet": [
  641. "users/anon",
  642. {
  643. "uid": "anon"
  644. }
  645. ]
  646. },
  647. {
  648. "changeUser": "user1",
  649. "stateExpect": {
  650. "numOutstandingWrites": 0
  651. }
  652. },
  653. {
  654. "userSet": [
  655. "users/user1",
  656. {
  657. "uid": "user1"
  658. }
  659. ]
  660. },
  661. {
  662. "userSet": [
  663. "users/user1",
  664. {
  665. "uid": "user1",
  666. "extra": true
  667. }
  668. ]
  669. },
  670. {
  671. "changeUser": null
  672. },
  673. {
  674. "restart": true,
  675. "stateExpect": {
  676. "activeTargets": {},
  677. "limboDocs": [],
  678. "numOutstandingWrites": 1
  679. }
  680. },
  681. {
  682. "writeAck": {
  683. "version": 1000
  684. }
  685. },
  686. {
  687. "changeUser": "user1"
  688. },
  689. {
  690. "restart": true,
  691. "stateExpect": {
  692. "activeTargets": {},
  693. "limboDocs": [],
  694. "numOutstandingWrites": 2
  695. }
  696. },
  697. {
  698. "writeAck": {
  699. "version": 2000
  700. }
  701. },
  702. {
  703. "writeAck": {
  704. "version": 3000
  705. }
  706. }
  707. ]
  708. },
  709. "Visible mutations reflect uid switches": {
  710. "describeName": "Persistence:",
  711. "itName": "Visible mutations reflect uid switches",
  712. "tags": [],
  713. "config": {
  714. "useGarbageCollection": true,
  715. "numClients": 1
  716. },
  717. "steps": [
  718. {
  719. "userListen": [
  720. 2,
  721. {
  722. "path": "users",
  723. "filters": [],
  724. "orderBys": []
  725. }
  726. ],
  727. "stateExpect": {
  728. "activeTargets": {
  729. "2": {
  730. "query": {
  731. "path": "users",
  732. "filters": [],
  733. "orderBys": []
  734. },
  735. "resumeToken": ""
  736. }
  737. }
  738. }
  739. },
  740. {
  741. "watchAck": [
  742. 2
  743. ]
  744. },
  745. {
  746. "watchEntity": {
  747. "docs": [
  748. {
  749. "key": "users/existing",
  750. "version": 0,
  751. "value": {
  752. "uid": "existing"
  753. },
  754. "options": {
  755. "hasLocalMutations": false,
  756. "hasCommittedMutations": false
  757. }
  758. }
  759. ],
  760. "targets": [
  761. 2
  762. ]
  763. }
  764. },
  765. {
  766. "watchCurrent": [
  767. [
  768. 2
  769. ],
  770. "resume-token-500"
  771. ]
  772. },
  773. {
  774. "watchSnapshot": {
  775. "version": 500,
  776. "targetIds": []
  777. },
  778. "expect": [
  779. {
  780. "query": {
  781. "path": "users",
  782. "filters": [],
  783. "orderBys": []
  784. },
  785. "added": [
  786. {
  787. "key": "users/existing",
  788. "version": 0,
  789. "value": {
  790. "uid": "existing"
  791. },
  792. "options": {
  793. "hasLocalMutations": false,
  794. "hasCommittedMutations": false
  795. }
  796. }
  797. ],
  798. "errorCode": 0,
  799. "fromCache": false,
  800. "hasPendingWrites": false
  801. }
  802. ]
  803. },
  804. {
  805. "userSet": [
  806. "users/anon",
  807. {
  808. "uid": "anon"
  809. }
  810. ],
  811. "expect": [
  812. {
  813. "query": {
  814. "path": "users",
  815. "filters": [],
  816. "orderBys": []
  817. },
  818. "added": [
  819. {
  820. "key": "users/anon",
  821. "version": 0,
  822. "value": {
  823. "uid": "anon"
  824. },
  825. "options": {
  826. "hasLocalMutations": true,
  827. "hasCommittedMutations": false
  828. }
  829. }
  830. ],
  831. "errorCode": 0,
  832. "fromCache": false,
  833. "hasPendingWrites": true
  834. }
  835. ]
  836. },
  837. {
  838. "changeUser": "user1",
  839. "stateExpect": {
  840. "activeTargets": {
  841. "2": {
  842. "query": {
  843. "path": "users",
  844. "filters": [],
  845. "orderBys": []
  846. },
  847. "resumeToken": "resume-token-500"
  848. }
  849. }
  850. },
  851. "expect": [
  852. {
  853. "query": {
  854. "path": "users",
  855. "filters": [],
  856. "orderBys": []
  857. },
  858. "removed": [
  859. {
  860. "key": "users/anon",
  861. "version": 0,
  862. "value": {
  863. "uid": "anon"
  864. },
  865. "options": {
  866. "hasLocalMutations": true,
  867. "hasCommittedMutations": false
  868. }
  869. }
  870. ],
  871. "errorCode": 0,
  872. "fromCache": false,
  873. "hasPendingWrites": false
  874. }
  875. ]
  876. },
  877. {
  878. "userSet": [
  879. "users/user1",
  880. {
  881. "uid": "user1"
  882. }
  883. ],
  884. "expect": [
  885. {
  886. "query": {
  887. "path": "users",
  888. "filters": [],
  889. "orderBys": []
  890. },
  891. "added": [
  892. {
  893. "key": "users/user1",
  894. "version": 0,
  895. "value": {
  896. "uid": "user1"
  897. },
  898. "options": {
  899. "hasLocalMutations": true,
  900. "hasCommittedMutations": false
  901. }
  902. }
  903. ],
  904. "errorCode": 0,
  905. "fromCache": false,
  906. "hasPendingWrites": true
  907. }
  908. ]
  909. },
  910. {
  911. "changeUser": null,
  912. "expect": [
  913. {
  914. "query": {
  915. "path": "users",
  916. "filters": [],
  917. "orderBys": []
  918. },
  919. "added": [
  920. {
  921. "key": "users/anon",
  922. "version": 0,
  923. "value": {
  924. "uid": "anon"
  925. },
  926. "options": {
  927. "hasLocalMutations": true,
  928. "hasCommittedMutations": false
  929. }
  930. }
  931. ],
  932. "removed": [
  933. {
  934. "key": "users/user1",
  935. "version": 0,
  936. "value": {
  937. "uid": "user1"
  938. },
  939. "options": {
  940. "hasLocalMutations": true,
  941. "hasCommittedMutations": false
  942. }
  943. }
  944. ],
  945. "errorCode": 0,
  946. "fromCache": false,
  947. "hasPendingWrites": true
  948. }
  949. ]
  950. }
  951. ]
  952. },
  953. "Detects all active clients": {
  954. "describeName": "Persistence:",
  955. "itName": "Detects all active clients",
  956. "tags": [
  957. "multi-client"
  958. ],
  959. "config": {
  960. "useGarbageCollection": false,
  961. "numClients": 2
  962. },
  963. "steps": [
  964. {
  965. "drainQueue": true,
  966. "clientIndex": 0
  967. },
  968. {
  969. "applyClientState": {
  970. "visibility": "hidden"
  971. },
  972. "stateExpect": {
  973. "numActiveClients": 1
  974. },
  975. "clientIndex": 0
  976. },
  977. {
  978. "drainQueue": true,
  979. "clientIndex": 1
  980. },
  981. {
  982. "applyClientState": {
  983. "visibility": "visible"
  984. },
  985. "stateExpect": {
  986. "numActiveClients": 2
  987. },
  988. "clientIndex": 1
  989. }
  990. ]
  991. },
  992. "Single tab acquires primary lease": {
  993. "describeName": "Persistence:",
  994. "itName": "Single tab acquires primary lease",
  995. "tags": [
  996. "multi-client"
  997. ],
  998. "config": {
  999. "useGarbageCollection": false,
  1000. "numClients": 2
  1001. },
  1002. "steps": [
  1003. {
  1004. "drainQueue": true,
  1005. "clientIndex": 0
  1006. },
  1007. {
  1008. "applyClientState": {
  1009. "visibility": "hidden"
  1010. },
  1011. "stateExpect": {
  1012. "isPrimary": true
  1013. },
  1014. "clientIndex": 0
  1015. },
  1016. {
  1017. "drainQueue": true,
  1018. "clientIndex": 1
  1019. },
  1020. {
  1021. "applyClientState": {
  1022. "visibility": "hidden"
  1023. },
  1024. "stateExpect": {
  1025. "isPrimary": false
  1026. },
  1027. "clientIndex": 1
  1028. },
  1029. {
  1030. "drainQueue": true,
  1031. "clientIndex": 0
  1032. },
  1033. {
  1034. "shutdown": true,
  1035. "stateExpect": {
  1036. "activeTargets": {},
  1037. "limboDocs": []
  1038. },
  1039. "clientIndex": 0
  1040. },
  1041. {
  1042. "drainQueue": true,
  1043. "clientIndex": 1
  1044. },
  1045. {
  1046. "runTimer": "client_metadata_refresh",
  1047. "stateExpect": {
  1048. "isPrimary": true
  1049. },
  1050. "clientIndex": 1
  1051. }
  1052. ]
  1053. },
  1054. "Foreground tab acquires primary lease": {
  1055. "describeName": "Persistence:",
  1056. "itName": "Foreground tab acquires primary lease",
  1057. "tags": [
  1058. "multi-client"
  1059. ],
  1060. "config": {
  1061. "useGarbageCollection": false,
  1062. "numClients": 3
  1063. },
  1064. "steps": [
  1065. {
  1066. "drainQueue": true,
  1067. "clientIndex": 0
  1068. },
  1069. {
  1070. "applyClientState": {
  1071. "visibility": "hidden"
  1072. },
  1073. "stateExpect": {
  1074. "isPrimary": true
  1075. },
  1076. "clientIndex": 0
  1077. },
  1078. {
  1079. "drainQueue": true,
  1080. "clientIndex": 1
  1081. },
  1082. {
  1083. "applyClientState": {
  1084. "visibility": "hidden"
  1085. },
  1086. "stateExpect": {
  1087. "isPrimary": false
  1088. },
  1089. "clientIndex": 1
  1090. },
  1091. {
  1092. "drainQueue": true,
  1093. "clientIndex": 2
  1094. },
  1095. {
  1096. "applyClientState": {
  1097. "visibility": "visible"
  1098. },
  1099. "stateExpect": {
  1100. "isPrimary": false
  1101. },
  1102. "clientIndex": 2
  1103. },
  1104. {
  1105. "drainQueue": true,
  1106. "clientIndex": 0
  1107. },
  1108. {
  1109. "shutdown": true,
  1110. "stateExpect": {
  1111. "activeTargets": {},
  1112. "limboDocs": []
  1113. },
  1114. "clientIndex": 0
  1115. },
  1116. {
  1117. "drainQueue": true,
  1118. "clientIndex": 1
  1119. },
  1120. {
  1121. "runTimer": "client_metadata_refresh",
  1122. "stateExpect": {
  1123. "isPrimary": false
  1124. },
  1125. "clientIndex": 1
  1126. },
  1127. {
  1128. "drainQueue": true,
  1129. "clientIndex": 2
  1130. },
  1131. {
  1132. "runTimer": "client_metadata_refresh",
  1133. "stateExpect": {
  1134. "isPrimary": true
  1135. },
  1136. "clientIndex": 2
  1137. }
  1138. ]
  1139. },
  1140. "Primary lease bound to network state": {
  1141. "describeName": "Persistence:",
  1142. "itName": "Primary lease bound to network state",
  1143. "tags": [
  1144. "multi-client"
  1145. ],
  1146. "config": {
  1147. "useGarbageCollection": false,
  1148. "numClients": 2
  1149. },
  1150. "steps": [
  1151. {
  1152. "drainQueue": true,
  1153. "stateExpect": {
  1154. "isPrimary": true
  1155. },
  1156. "clientIndex": 0
  1157. },
  1158. {
  1159. "enableNetwork": false,
  1160. "stateExpect": {
  1161. "activeTargets": {},
  1162. "limboDocs": [],
  1163. "isPrimary": true
  1164. },
  1165. "clientIndex": 0
  1166. },
  1167. {
  1168. "drainQueue": true,
  1169. "stateExpect": {
  1170. "isPrimary": false
  1171. },
  1172. "clientIndex": 1
  1173. },
  1174. {
  1175. "drainQueue": true,
  1176. "clientIndex": 0
  1177. },
  1178. {
  1179. "runTimer": "client_metadata_refresh",
  1180. "stateExpect": {
  1181. "isPrimary": false
  1182. },
  1183. "clientIndex": 0
  1184. },
  1185. {
  1186. "drainQueue": true,
  1187. "clientIndex": 1
  1188. },
  1189. {
  1190. "runTimer": "client_metadata_refresh",
  1191. "stateExpect": {
  1192. "isPrimary": true
  1193. },
  1194. "clientIndex": 1
  1195. },
  1196. {
  1197. "enableNetwork": false,
  1198. "stateExpect": {
  1199. "activeTargets": {},
  1200. "limboDocs": [],
  1201. "isPrimary": true
  1202. },
  1203. "clientIndex": 1
  1204. },
  1205. {
  1206. "drainQueue": true,
  1207. "clientIndex": 0
  1208. },
  1209. {
  1210. "enableNetwork": true,
  1211. "stateExpect": {
  1212. "isPrimary": false
  1213. },
  1214. "clientIndex": 0
  1215. },
  1216. {
  1217. "drainQueue": true,
  1218. "clientIndex": 1
  1219. },
  1220. {
  1221. "runTimer": "client_metadata_refresh",
  1222. "stateExpect": {
  1223. "isPrimary": false
  1224. },
  1225. "clientIndex": 1
  1226. },
  1227. {
  1228. "drainQueue": true,
  1229. "clientIndex": 0
  1230. },
  1231. {
  1232. "runTimer": "client_metadata_refresh",
  1233. "stateExpect": {
  1234. "isPrimary": true
  1235. },
  1236. "clientIndex": 0
  1237. }
  1238. ]
  1239. },
  1240. "clearPersistence() shuts down other clients": {
  1241. "describeName": "Persistence:",
  1242. "itName": "clearPersistence() shuts down other clients",
  1243. "tags": [
  1244. "multi-client"
  1245. ],
  1246. "config": {
  1247. "useGarbageCollection": false,
  1248. "numClients": 3
  1249. },
  1250. "steps": [
  1251. {
  1252. "drainQueue": true,
  1253. "clientIndex": 0
  1254. },
  1255. {
  1256. "applyClientState": {
  1257. "visibility": "visible"
  1258. },
  1259. "clientIndex": 0
  1260. },
  1261. {
  1262. "drainQueue": true,
  1263. "clientIndex": 1
  1264. },
  1265. {
  1266. "drainQueue": true,
  1267. "clientIndex": 2
  1268. },
  1269. {
  1270. "drainQueue": true,
  1271. "clientIndex": 0
  1272. },
  1273. {
  1274. "shutdown": true,
  1275. "stateExpect": {
  1276. "activeTargets": {},
  1277. "limboDocs": []
  1278. },
  1279. "clientIndex": 0
  1280. },
  1281. {
  1282. "clearPersistence": true,
  1283. "clientIndex": 0
  1284. },
  1285. {
  1286. "drainQueue": true,
  1287. "clientIndex": 1
  1288. },
  1289. {
  1290. "expectIsShutdown": true,
  1291. "clientIndex": 1
  1292. },
  1293. {
  1294. "drainQueue": true,
  1295. "clientIndex": 2
  1296. },
  1297. {
  1298. "expectIsShutdown": true,
  1299. "clientIndex": 2
  1300. }
  1301. ]
  1302. }
  1303. }