commit 7f9b8ca9eaa38b57af41cf07da128354c2bb53bb Merge: a8ae136 1f4b2b4 Author: Marco Miller Date: Tue Oct 6 13:18:25 2020 -0400 Merge branch 'stable-3.1' into stable-3.2 * stable-3.1: Update git submodules Bump Bazel version to 3.5.1 Upgrade jackson-core to 2.11.3 Update git submodules Register graceful shutdown for version command Register graceful shutdown for show queue command Register graceful shutdown for show connections command Register graceful shutdown for show caches command Register graceful shutdown for set reviewers command Register graceful shutdown for set project command Register graceful shutdown for set parent command Register graceful shutdown for set members command Register graceful shutdown for set logging level command Register graceful shutdown for set head command Register graceful shutdown for set account command Register graceful shutdown for review command Register graceful shutdown for rename group command Register graceful shutdown for reload config command Register graceful shutdown for query command Register graceful shutdown for list plugins command Register graceful shutdown for plugin admin commands Register graceful shutdown for list user refs command Register graceful shutdown for list projects command Register graceful shutdown for list members command Register graceful shutdown for list logging level command Register graceful shutdown for list groups command Register graceful shutdown for kill command Register graceful shutdown for index start command Register graceful shutdown for index changes in project command Register graceful shutdown for index changes command Register graceful shutdown for index activate command Register graceful shutdown for gc command Register graceful shutdown for flush caches command Register graceful shutdown for create project command Register graceful shutdown for create group command Register graceful shutdown for create branch command Register graceful shutdown for create account command Register graceful shutdown for close connection command Register graceful shutdown for prolog test commands Register graceful shutdown for ban commit command Register graceful shutdown for apropos command Limit graceful shutdown to SSH sessions serving git requests Update git submodules Change-Id: I7e962cf4760dcc77ef1e87d34243cf1c0fb6078a diff --cc java/com/google/gerrit/acceptance/AbstractDaemonTest.java index 89cc724,8b7f9a0..f29cdb2 --- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java +++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java @@@ -388,7 -377,17 +388,16 @@@ public abstract class AbstractDaemonTes initSsh(); } + protected void restart() throws Exception { + server = GerritServer.restart(server, createModule(), createSshModule()); + server.getTestInjector().injectMembers(this); + if (resetter != null) { + server.getTestInjector().injectMembers(resetter); + } + initSsh(); + } + - protected void evictAndReindexAccount(Account.Id accountId) { - accountCache.evict(accountId); + protected void reindexAccount(Account.Id accountId) { accountIndexer.index(accountId); } diff --cc java/com/google/gerrit/acceptance/SshSession.java index 6ecf85f,fd60d16..6698657 --- a/java/com/google/gerrit/acceptance/SshSession.java +++ b/java/com/google/gerrit/acceptance/SshSession.java @@@ -65,6 -66,35 +65,22 @@@ public class SshSession } } + @SuppressWarnings("resource") + public int execAndReturnStatus(String command) throws Exception { + ChannelExec channel = (ChannelExec) getSession().openChannel("exec"); + try { + channel.setCommand(command); + InputStream err = channel.getErrStream(); + channel.connect(); + + Scanner s = new Scanner(err, UTF_8.name()).useDelimiter("\\A"); + error = s.hasNext() ? s.next() : null; + return channel.getExitStatus(); + } finally { + channel.disconnect(); + } + } + - public InputStream exec2(String command, InputStream opt) throws Exception { - ChannelExec channel = (ChannelExec) getSession().openChannel("exec"); - channel.setCommand(command); - channel.setInputStream(opt); - InputStream in = channel.getInputStream(); - channel.connect(); - return in; - } - - public String exec(String command) throws Exception { - return exec(command, null); - } - private boolean hasError() { return error != null; } diff --cc java/com/google/gerrit/pgm/Daemon.java index 3846900,238cf29..10f5ba3 --- a/java/com/google/gerrit/pgm/Daemon.java +++ b/java/com/google/gerrit/pgm/Daemon.java @@@ -527,9 -521,10 +533,11 @@@ public class Daemon extends SiteProgra replica, sysInjector.getInstance(DownloadConfig.class), sysInjector.getInstance(LfsPluginAuthCommand.Module.class))); + + modules.addAll(testSshModules); if (!replica) { modules.add(new IndexCommandsModule(sysInjector)); + modules.add(new SequenceCommandsModule()); } return sysInjector.createChildInjector(modules); }