Merge branch 'stable-2.14'
* stable-2.14: Prevents 2x stop() calls during IntegrationTest Add missing documentation of assignee related search operators Rename StartStopDeamonIT to StartStopDaemonIT Add integration test to check for thread leaks in sandboxed Daemon tests Fix intopic predicate with regex Change-Id: Icea87f9bed4711ee2744e5d2a0127b50297df046
This commit is contained in:
@@ -61,6 +61,11 @@ to include a unit suffix, for example `age:2d`:
|
||||
* mon, month, months (`1 month` is treated as `30 days`)
|
||||
* y, year, years (`1 year` is treated as `365 days`)
|
||||
|
||||
[[assignee]]
|
||||
assignee:'USER'::
|
||||
+
|
||||
Changes assigned to the given user.
|
||||
|
||||
[[before_until]]
|
||||
before:'TIME'/until:'TIME'::
|
||||
+
|
||||
@@ -289,12 +294,20 @@ has:unresolved::
|
||||
True if the change has unresolved comments.
|
||||
|
||||
[[is]]
|
||||
is:assigned::
|
||||
+
|
||||
True if the change has an assignee.
|
||||
|
||||
[[is-starred]]
|
||||
is:starred::
|
||||
+
|
||||
Same as 'has:star', true if the change has been starred by the
|
||||
current user with the default label.
|
||||
|
||||
is:unassigned::
|
||||
+
|
||||
True if the change does not have an assignee.
|
||||
|
||||
is:watched::
|
||||
+
|
||||
True if this change matches one of the current user's watch filters,
|
||||
|
||||
@@ -501,7 +501,7 @@ public abstract class AbstractDaemonTest {
|
||||
return GitUtil.cloneProject(p, inProcessProtocol.register(ctx, repo).toString());
|
||||
}
|
||||
|
||||
private void afterTest() throws Exception {
|
||||
protected void afterTest() throws Exception {
|
||||
Transport.unregister(inProcessProtocol);
|
||||
for (Repository repo : toClose) {
|
||||
repo.close();
|
||||
@@ -515,6 +515,7 @@ public abstract class AbstractDaemonTest {
|
||||
}
|
||||
if (server != commonServer) {
|
||||
server.stop();
|
||||
server = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) 2017 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.acceptance.pgm;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.Sandboxed;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.ThreadMXBean;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.Description;
|
||||
|
||||
@Sandboxed
|
||||
public class StartStopDaemonIT extends AbstractDaemonTest {
|
||||
Description suiteDescription = Description.createSuiteDescription(StartStopDaemonIT.class);
|
||||
|
||||
@Test
|
||||
public void sandboxedDaemonDoesNotLeakThreads() throws Exception {
|
||||
ThreadMXBean thbean = ManagementFactory.getThreadMXBean();
|
||||
int startThreads = thbean.getThreadCount();
|
||||
beforeTest(suiteDescription);
|
||||
afterTest();
|
||||
assertThat(Thread.activeCount()).isLessThan(startThreads);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
package com.google.gerrit.server.query.change;
|
||||
|
||||
import static com.google.gerrit.server.index.change.ChangeField.FUZZY_TOPIC;
|
||||
import static com.google.gerrit.server.index.change.ChangeField.EXACT_TOPIC;
|
||||
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
@@ -25,7 +25,7 @@ class RegexTopicPredicate extends ChangeRegexPredicate {
|
||||
private final RunAutomaton pattern;
|
||||
|
||||
RegexTopicPredicate(String re) {
|
||||
super(FUZZY_TOPIC, re);
|
||||
super(EXACT_TOPIC, re);
|
||||
|
||||
if (re.startsWith("^")) {
|
||||
re = re.substring(1);
|
||||
|
||||
@@ -573,6 +573,8 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
||||
assertQuery("intopic:fixup", change4);
|
||||
assertQuery("topic:\"\"", change5);
|
||||
assertQuery("intopic:\"\"", change5);
|
||||
assertQuery("intopic:^feature2.*", change4, change2);
|
||||
assertQuery("intopic:{^.*feature2$}", change3, change2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user