Skip to content

Commit 8d506ba

Browse files
committed
Remove leftover middleware perf debugging code
1 parent 2b864ed commit 8d506ba

File tree

1 file changed

+3
-54
lines changed

1 file changed

+3
-54
lines changed

packages/toolkit/src/query/tests/cleanup.test.tsx

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,6 @@ test('Minimizes the number of subscription dispatches when multiple components a
162162
withoutTestLifecycles: true,
163163
})
164164

165-
const onProfile: ProfilerOnRenderCallback = (
166-
id,
167-
phase,
168-
actualDuration,
169-
baseDuration,
170-
startTime,
171-
commitTime
172-
) => {
173-
console.table({
174-
phase,
175-
actualDuration,
176-
baseDuration,
177-
})
178-
}
179-
180165
let getSubscriptionsA = () =>
181166
storeRef.store.getState().api.subscriptions['a(undefined)']
182167

@@ -199,50 +184,19 @@ test('Minimizes the number of subscription dispatches when multiple components a
199184
return <>{listItems}</>
200185
}
201186

202-
const start = Date.now()
203-
204-
render(
205-
// <Profiler id="a" onRender={onProfile}>
206-
<ParentComponent />,
207-
// </Profiler>,
208-
{
209-
wrapper: storeRef.wrapper,
210-
}
211-
)
212-
213-
const afterRender = Date.now()
187+
render(<ParentComponent />, {
188+
wrapper: storeRef.wrapper,
189+
})
214190

215191
jest.advanceTimersByTime(10)
216192

217-
const afterTimers1 = Date.now()
218-
219193
await waitFor(() => {
220194
return screen.getAllByText(/42/).length > 0
221195
})
222196

223-
const afterScreen = Date.now()
224-
225197
await runAllTimers()
226198

227-
const end = Date.now()
228-
229-
const timeElapsed = end - start
230-
// const renderTime = afterRender - start
231-
// const timer1Time = afterTimers1 - afterRender
232-
// const screenTime = afterScreen - afterTimers1
233-
// const timer2Time = end - afterScreen
234-
235-
// console.table({
236-
// timeElapsed,
237-
// renderTime,
238-
// timer1Time,
239-
// screenTime,
240-
// timer2Time,
241-
// })
242-
243-
// console.log('Getting final subscriptions')
244199
const subscriptions = getSubscriptionsA()
245-
// console.log(actionTypes)
246200

247201
expect(Object.keys(subscriptions!).length).toBe(NUM_LIST_ITEMS)
248202

@@ -252,9 +206,4 @@ test('Minimizes the number of subscription dispatches when multiple components a
252206
'api/internalSubscriptions/subscriptionsUpdated',
253207
'api/executeQuery/fulfilled',
254208
])
255-
256-
// Could be flaky in CI, but we'll see.
257-
// Currently seeing 800ms in local dev, 6300 without the batching fixes
258-
// console.log('Elapsed subscription time: ', timeElapsed)
259-
expect(timeElapsed).toBeLessThan(1500)
260209
}, 25000)

0 commit comments

Comments
 (0)