Fix selenium tests in factory package#10921
Conversation
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
| } | ||
|
|
||
| private CompletableFuture<ServerCapabilities> getOrInitializeLanguageServer() { | ||
| if (serverCapabilities.get() == null) { |
There was a problem hiding this comment.
It makes no sense to do an AtomicReference and synchronized protection.
| } | ||
| } | ||
|
|
||
| private CompletableFuture<ServerCapabilities> getOrInitializeLanguageServer() { |
There was a problem hiding this comment.
We should not do this. Whether we decide to initialize a server or not should be done by the server initializer. Don't cache the result, it's not worth it.
| public MavenProjectInitHandler(WorkspaceSynchronizer workspaceSynchronizer) { | ||
| this.workspaceSynchronizer = workspaceSynchronizer; | ||
| } | ||
| public MavenProjectInitHandler(WorkspaceSynchronizer workspaceSynchronizer) {} |
There was a problem hiding this comment.
If we're not using it, remove the parameter.
|
|
||
| workspaceSynchronizer.syncronizerWorkspaceAsync(params); | ||
| } | ||
| public void onProjectInitialized(String projectFolder) {} |
There was a problem hiding this comment.
This looks like we're not using this project initializer anymore. Can you explain how this made a selenium test fail and why we need to change it?
Generally, I think this kind of "meaningful" change would warrant a separate bug report and PR.
There was a problem hiding this comment.
Using MavenProjectInitHandler leads us to endless cycle:
- Project with problems is imported
JavaLanguageServerExtensionService.updateWorkspaceis invokedJavaLanguageServerExtensionService.updateProjectsWithProblemsis invokedMavenProjectInitHandler.onProjectInitializedis invoked.WorkspaceSynchronizer.syncronizerWorkspaceAsyncis invoked- -> 2
| BadRequestException { | ||
| if (wsPath != null) { | ||
| projectConfigDto.setPath(absolutize(wsPath)); | ||
| wsPath = absolutize(wsPath); |
There was a problem hiding this comment.
Again, what was the bug here?
There was a problem hiding this comment.
absolutize ensure that project path starts with /.
Without that it leads it emitting ProjectCreatedEvent for already registered projects.
Have a look at code below:
boolean registeredEarly = projectManager.isRegistered(wsPath);
RegisteredProject updated = projectManager.update(projectConfigDto);
Without absolutize registration checking and updating will be performed for different project paths.
svor
left a comment
There was a problem hiding this comment.
One point here. All existed factories which use java won't work after merging jdt.ls into master because they don't have org.eclipse.che.ls.java installer. It can be a problem.
|
@tsmaeder Could you have a look again? |
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
* Fix selenium tests in factory package Signed-off-by: Anatoliy Bazko <abazko@redhat.com> * Fixup Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
Signed-off-by: Anatoliy Bazko abazko@redhat.com
What does this PR do?
Fixes tests in
factorypackageWhat issues does this PR fix or reference?
#10919
Release Notes
Docs PR