persistence_spec_test.json 28 KB

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