@@ -102,57 +102,53 @@ describeSpec('Performance Tests:', ['benchmark'], () => {
102
102
return steps ;
103
103
} ) ;
104
104
105
- specTest (
106
- 'Update a single document and wait for snapshot' ,
107
- [ ] ,
108
- ( ) => {
109
- let version = 1 ;
110
-
111
- const query = Query . atPath ( path ( `collection/doc` ) ) ;
112
- let docLocal = doc (
105
+ specTest ( 'Update a single document and wait for snapshot' , [ ] , ( ) => {
106
+ let version = 1 ;
107
+
108
+ const query = Query . atPath ( path ( `collection/doc` ) ) ;
109
+ let docLocal = doc (
110
+ `collection/doc` ,
111
+ 0 ,
112
+ { v : 0 } ,
113
+ { hasLocalMutations : true }
114
+ ) ;
115
+ let docRemote = doc ( `collection/doc` , ++ version , { v : 0 } ) ;
116
+ let lastRemoteVersion = version ;
117
+
118
+ let steps = spec ( ) . withGCEnabled ( false ) ;
119
+
120
+ steps = steps
121
+ . userListens ( query )
122
+ . userSets ( `collection/doc` , { v : 0 } )
123
+ . expectEvents ( query , {
124
+ added : [ docLocal ] ,
125
+ fromCache : true ,
126
+ hasPendingWrites : true
127
+ } )
128
+ . writeAcks ( ++ version )
129
+ . watchAcksFull ( query , ++ version , docRemote )
130
+ . expectEvents ( query , { metadata : [ docRemote ] } ) ;
131
+
132
+ for ( let i = 1 ; i <= STEP_COUNT ; ++ i ) {
133
+ docLocal = doc (
113
134
`collection/doc` ,
114
- 0 ,
115
- { v : 0 } ,
135
+ lastRemoteVersion ,
136
+ { v : i } ,
116
137
{ hasLocalMutations : true }
117
138
) ;
118
- let docRemote = doc ( `collection/doc` , ++ version , { v : 0 } ) ;
119
- let lastRemoteVersion = version ;
120
-
121
- let steps = spec ( ) . withGCEnabled ( false ) ;
139
+ docRemote = doc ( `collection/doc` , ++ version , { v : i } ) ;
140
+ lastRemoteVersion = version ;
122
141
123
142
steps = steps
124
- . userListens ( query )
125
- . userSets ( `collection/doc` , { v : 0 } )
126
- . expectEvents ( query , {
127
- added : [ docLocal ] ,
128
- fromCache : true ,
129
- hasPendingWrites : true
130
- } )
143
+ . userPatches ( `collection/doc` , { v : i } )
144
+ . expectEvents ( query , { modified : [ docLocal ] , hasPendingWrites : true } )
131
145
. writeAcks ( ++ version )
132
- . watchAcksFull ( query , ++ version , docRemote )
146
+ . watchSends ( { affects : [ query ] } , docRemote )
147
+ . watchSnapshots ( ++ version )
133
148
. expectEvents ( query , { metadata : [ docRemote ] } ) ;
134
-
135
- for ( let i = 1 ; i <= STEP_COUNT ; ++ i ) {
136
- docLocal = doc (
137
- `collection/doc` ,
138
- lastRemoteVersion ,
139
- { v : i } ,
140
- { hasLocalMutations : true }
141
- ) ;
142
- docRemote = doc ( `collection/doc` , ++ version , { v : i } ) ;
143
- lastRemoteVersion = version ;
144
-
145
- steps = steps
146
- . userPatches ( `collection/doc` , { v : i } )
147
- . expectEvents ( query , { modified : [ docLocal ] , hasPendingWrites : true } )
148
- . writeAcks ( ++ version )
149
- . watchSends ( { affects : [ query ] } , docRemote )
150
- . watchSnapshots ( ++ version )
151
- . expectEvents ( query , { metadata : [ docRemote ] } ) ;
152
- }
153
- return steps ;
154
149
}
155
- ) ;
150
+ return steps ;
151
+ } ) ;
156
152
157
153
specTest ( 'Watch sends 100 documents' , [ ] , ( ) => {
158
154
let version = 1 ;
0 commit comments