index_spec_test.json 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. {
  2. "Index Creation succeeds even if not primary": {
  3. "describeName": "Client Side Index",
  4. "itName": "Index Creation succeeds even if not primary",
  5. "tags": [
  6. "multi-client"
  7. ],
  8. "config": {
  9. "numClients": 2,
  10. "useEagerGCForMemory": false
  11. },
  12. "steps": [
  13. {
  14. "clientIndex": 0,
  15. "drainQueue": true,
  16. "expectedState": {
  17. "isPrimary": true
  18. }
  19. },
  20. {
  21. "clientIndex": 1,
  22. "drainQueue": true,
  23. "expectedState": {
  24. "isPrimary": false
  25. }
  26. },
  27. {
  28. "clientIndex": 1,
  29. "setIndexConfiguration": {
  30. "indexes": [
  31. {
  32. "collectionGroup": "restaurants",
  33. "fields": [
  34. {
  35. "fieldPath": "price",
  36. "order": "ASCENDING"
  37. }
  38. ],
  39. "queryScope": "COLLECTION"
  40. }
  41. ]
  42. },
  43. "expectedState": {
  44. "indexes": [
  45. {
  46. "collectionGroup": "restaurants",
  47. "fields": [
  48. {
  49. "fieldPath": {
  50. "len": 1,
  51. "offset": 0,
  52. "segments": [
  53. "price"
  54. ]
  55. },
  56. "kind": 0
  57. }
  58. ],
  59. "indexId": -1,
  60. "indexState": {
  61. "offset": {
  62. "documentKey": {
  63. "path": {
  64. "len": 0,
  65. "offset": 0,
  66. "segments": [
  67. ]
  68. }
  69. },
  70. "largestBatchId": -1,
  71. "readTime": {
  72. "timestamp": {
  73. "nanoseconds": 0,
  74. "seconds": 0,
  75. "type": "firestore/timestamp/1.0"
  76. }
  77. }
  78. },
  79. "sequenceNumber": 0
  80. }
  81. }
  82. ]
  83. }
  84. },
  85. {
  86. "clientIndex": 0,
  87. "drainQueue": true,
  88. "expectedState": {
  89. "indexes": [
  90. {
  91. "collectionGroup": "restaurants",
  92. "fields": [
  93. {
  94. "fieldPath": {
  95. "len": 1,
  96. "offset": 0,
  97. "segments": [
  98. "price"
  99. ]
  100. },
  101. "kind": 0
  102. }
  103. ],
  104. "indexId": -1,
  105. "indexState": {
  106. "offset": {
  107. "documentKey": {
  108. "path": {
  109. "len": 0,
  110. "offset": 0,
  111. "segments": [
  112. ]
  113. }
  114. },
  115. "largestBatchId": -1,
  116. "readTime": {
  117. "timestamp": {
  118. "nanoseconds": 0,
  119. "seconds": 0,
  120. "type": "firestore/timestamp/1.0"
  121. }
  122. }
  123. },
  124. "sequenceNumber": 0
  125. }
  126. }
  127. ]
  128. }
  129. }
  130. ]
  131. },
  132. "Index Creation visible on all clients": {
  133. "describeName": "Client Side Index",
  134. "itName": "Index Creation visible on all clients",
  135. "tags": [
  136. "multi-client"
  137. ],
  138. "config": {
  139. "numClients": 2,
  140. "useEagerGCForMemory": false
  141. },
  142. "steps": [
  143. {
  144. "clientIndex": 0,
  145. "drainQueue": true,
  146. "expectedState": {
  147. "isPrimary": true
  148. }
  149. },
  150. {
  151. "clientIndex": 0,
  152. "setIndexConfiguration": {
  153. "indexes": [
  154. {
  155. "collectionGroup": "restaurants",
  156. "fields": [
  157. {
  158. "fieldPath": "price",
  159. "order": "ASCENDING"
  160. }
  161. ],
  162. "queryScope": "COLLECTION"
  163. }
  164. ]
  165. },
  166. "expectedState": {
  167. "indexes": [
  168. {
  169. "collectionGroup": "restaurants",
  170. "fields": [
  171. {
  172. "fieldPath": {
  173. "len": 1,
  174. "offset": 0,
  175. "segments": [
  176. "price"
  177. ]
  178. },
  179. "kind": 0
  180. }
  181. ],
  182. "indexId": -1,
  183. "indexState": {
  184. "offset": {
  185. "documentKey": {
  186. "path": {
  187. "len": 0,
  188. "offset": 0,
  189. "segments": [
  190. ]
  191. }
  192. },
  193. "largestBatchId": -1,
  194. "readTime": {
  195. "timestamp": {
  196. "nanoseconds": 0,
  197. "seconds": 0,
  198. "type": "firestore/timestamp/1.0"
  199. }
  200. }
  201. },
  202. "sequenceNumber": 0
  203. }
  204. }
  205. ]
  206. }
  207. },
  208. {
  209. "clientIndex": 1,
  210. "drainQueue": true,
  211. "expectedState": {
  212. "indexes": [
  213. {
  214. "collectionGroup": "restaurants",
  215. "fields": [
  216. {
  217. "fieldPath": {
  218. "len": 1,
  219. "offset": 0,
  220. "segments": [
  221. "price"
  222. ]
  223. },
  224. "kind": 0
  225. }
  226. ],
  227. "indexId": -1,
  228. "indexState": {
  229. "offset": {
  230. "documentKey": {
  231. "path": {
  232. "len": 0,
  233. "offset": 0,
  234. "segments": [
  235. ]
  236. }
  237. },
  238. "largestBatchId": -1,
  239. "readTime": {
  240. "timestamp": {
  241. "nanoseconds": 0,
  242. "seconds": 0,
  243. "type": "firestore/timestamp/1.0"
  244. }
  245. }
  246. },
  247. "sequenceNumber": 0
  248. }
  249. }
  250. ],
  251. "isPrimary": false
  252. }
  253. }
  254. ]
  255. }
  256. }