-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telescope resumes recording after JobProcessing event #719
Comments
I've run into a similar issue that eventually breaks tests as the watcher exhausts the allotted memory. I personally don't see a need to have Telescope active during tests, so I've added the following to my phpunit.xml
|
Thanks for this. If anyone was wondering why telescope was logging its own events, it might be your middleware is firing a sync event, as was our case. Then logging doesn't get turned off when the telescope page loads. The PR should fix it. |
Looks like this was fixed by a PR and has since been released. |
Thanks for the release! |
Hi there,
In order to speed up some seeds we've added
Telescope::stopRecording()
at the beginning of the commands/seeds. This should prevent Telescope from recording, however, the seeders are still slower, and consuming more memory compared to having Telescope disabled. This didn't seem right, so I started inspecting with the debugger.What I found out, was that Telescope was still recording queries event though I had set it to stop recording. Using call tracing I found out that
Laravel\Telescope\Watchers\QueryWatcher::recordQuery
was still being called and using significant time. Fast forward to the debugger, and I found out that Telescope was somehow enabled again. A model in our seeder was dispatching a job that was executed synchronously. This triggered the following event listener in Telescope, which set Telescope to start recording again.telescope/src/ListensForStorageOpportunities.php
Lines 56 to 60 in d9c5c53
I do not think this behaviour is how it should work. It seems a bit odd that even though I tell Telescope to stop recording, due to a listener it starts recording again.
I've set up an example repository in a new Laravel project that shows the bug at https://github.com/erikgaal/telescope-recording-bug-example. I've also added a test that confirms the wrong behaviour.
https://github.com/erikgaal/telescope-recording-bug-example/blob/7d0812e2bbb4e63b9ae090282b0d4edda9519fd8/tests/Unit/ExampleTest.php#L17-L28
The text was updated successfully, but these errors were encountered: