-
Notifications
You must be signed in to change notification settings - Fork 56
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
[Reopen] Migration of events from the debugger UI to the debugger action model to automate its updates #399
Conversation
So, the CI is green here... I'm confused and don't know how to deal with the problem |
I sadly have no idea... |
maybe we can try again to merge it and then analyse the problem on the other CI.. but from my side this has to wait till after August 15 |
I investigated the problem on the build artefact you gave me and found out that there's still a memory leak somewhere. I'm using NewCommandLineRunner. This is a tool in development that allows to run tests in the order we want, and that opens a debugger each time that an error or a failure occurs. It also stores the results of all tests in xml files named after the executed packages. I discovered that there's a particular test that make the image crash. Even, when I change the execution order for test cases, it's always the same debugger test that is problematic. But it only happens when I execute all debugger tests. If I run only the package that contains the problematic test, there's no error. I think (and I hope) that I will manage to find where the memory leak is, and the cause of the crash (The crash is certainly the reason why all tests failed on the CI after merge) thanks to this tool. But it's quite a shame that it's not possible to have a direct access to the other CI, without merging |
…er references weak in the action model not to prevent them from being garbage collected. So for now, systematically clearing the action model when a debugger is cleared prevents two different debuggers to have the same action model. This MAY be changed in the future
We don't know why but this test cause some variables, in this test or in the test runner that runs this test, to become nil. This should be investigated in the future
So here are the changes that I made to close the memory leak:
Furthermore, I skipped a specific test: For now, this test pass if it is run via the system browser but if you debug this test and perform In addition, it depends on the test runner that is used to run the test! If I use |
It looks like it solves the memory leak. For example, when we open a debugger, close it and save the image, then However, when I run all tests via TestRunner, the world breaks: a lot of windows that are opened in tests aren't closed and debuggers are not garbage collected easily. For instance, if you open a debugger, close it and save the image, |
Actually, if I run all tests via TestRunner on an image after the revert, I get the same problem. So, I don't think that my PR is cause of the problem |
If this PR is merged again, we need a plan to quickly analyse the cause of the problem to fix it. What bothers me is that the production CI failed all tests with this error: "FileWriteError: File Tests-osx-64-NewTools-Debugger-Tests-Test.xml is closed" but I never could reproduce the problem with the CI build artefact. As I said, a particular test fails depending on the test runner that is used to run tests. So I would like to know what tool is used by the production CI to run tests. I'm also curious to know if the production CI will work properly as I skip the problematic test I've noticed |
I managed to reproduce the production CI error: "FileWriteError: File Tests-osx-64-NewTools-Debugger-Tests-Test.xml is closed" with @aboubacardiawara, with the CommandLineRunner. I get the error when When we skip it, tests are green and we only get warnings from
I think this can be merged and that the problematic test should be skipped, and investigated later because this is not a simple bug at all |
Do not merge this one yet we need to investigate it more to be sure. |
There are conflicts now |
Yes, I'm not surprised. This PR has been pending for too long and now, some other changes will complicate things. I will try to fix that and see with @StevenCostiou if we can integrate it (I think we can as I think I had isolated the problematic test) this month |
…ot-updated-automatically-needs-refactoring
… to unsubscribe from MethodAdded announcements. Now, it is necessary for StDebuggerExtensionToggleAnnouncement)
… when the session is set on the debugger
…ts, as tests run in the UI thread
Still unrelated failing tests. What I basically did is:
|
So many tests are red now... From the looks of it, I guess a PR with some debugger tests that are not well-written has been merged. I will look at that because I want to merge this PR as soon as possible. The more we wait, the more complicated it gets to integrate it |
…-model-is-not-updated-automatically-needs-refactoring
…ebugger to prevent memory leaks + fixing a test consequently
…g the debugger event migration PR
…migration Help debug 367 stdebugger event migration
…bug session's #clear event is raised; in order to unsubscribe from everything automatically
To me, everything looks good. We just need pharo-project/pharo#14670 to be merged first. This PR introduces a mechanism that should prevent ANY problem of subscription that is not cancelled, as we had in the past |
Action model clear event introduction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a global review, more specifically on the latest changes since I already did review the previous ones, but they are much older and my memory is not fresh.
It looks good, and better than before.
I suggest we merge the PR tomorrow, and monitor its impact just in case.
@jecisc The failing test is an undeclared in Tonel, I thnk you said somewhere we can merge PRs with this problem? |
Yes and this is now fixed! :) |
Fixes #367
In StDebugger, the session was accessed through a session holder. So, it was subscribed to the session holder to update itself and the action model when the session state - or the session itself - had changed. However, it should not be the case, as the action model should be able to exist without a GUI. Furthermore, the action model has access to the session so it could play the role of a session holder...
As a result, the action model is now subscribed to the session and handles all events that were handled in StDebugger before and StDebugger is now subscribed to the action model, which notifies the GUI when it has to update.
This migration of events was also the occasion to remove unused update hooks related to these updates.
Some Sindarin commands used to unsubscribe the debugger from the session to perform several actions and update the debugger only once. This is now handled by an "update guard" system in StDebuggerActionModel, notably thanks to the preventUpdatesDuring: method.
The handling of the MethodAdded event from the SystemAnnouncer, has been migrated from StDebuger to StDebuggerActionModel for the same reasons.
It's for now the same as the PR #368 that has been reverted because unstable. I reopen it the PR to fix it