Skip to content
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

JENKINS-32124: attempt to fix startup failure #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public void start() throws Exception {
// because, for some unknown reasons, we reach plexus bootstraping exceptions when
// calling Embedder.start() when everything is loaded (very strange...)
SCMManagerFactory.getInstance().start();
initialInit();
}

public void loadData(ScmSyncConfigurationPOJO pojo){
Expand All @@ -166,14 +165,6 @@ public void loadData(ScmSyncConfigurationPOJO pojo){
this.manualSynchronizationIncludes = pojo.getManualSynchronizationIncludes();
}

protected void initialInit() throws Exception {
// We need to init() here in addition to ScmSyncConfigurationItemListener.onLoaded() to ensure that we do
// indeed create the SCM work directory when we are loaded. Otherwise, the plugin can be installed but
// then fails to operate until the next time Jenkins is restarted. Using postInitialize() for this might
// be too late if the plugin is copied to the plugin directory and then Jenkins is started.
this.business.init(createScmContext());
}

public void init() {
try {
this.business.init(createScmContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ public void setup() throws Throwable {
// Instantiating ScmSyncConfigurationPlugin instance for unit tests by using
// synchronous transactions (instead of an asynchronous ones)
// => this way, every commit will be processed synchronously !
ScmSyncConfigurationPlugin scmSyncConfigPluginInstance = new ScmSyncConfigurationPlugin(true) {
@Override
public void initialInit() throws Exception {
// No-op. We *must not* initialize here in tests because the tests provide their own setup.
}
};
ScmSyncConfigurationPlugin scmSyncConfigPluginInstance = new ScmSyncConfigurationPlugin(true);

// Mocking PluginWrapper attached to current ScmSyncConfigurationPlugin instance
PluginWrapper pluginWrapper = PowerMockito.mock(PluginWrapper.class);
Expand Down