Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
25 changes: 21 additions & 4 deletions .mvn/maven-build-cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<enabled>true</enabled>
<hashAlgorithm>SHA-256</hashAlgorithm>
<validateXml>true</validateXml>
<remote enabled="false" id="cache-remote-server">
<mandatoryClean>true</mandatoryClean>
<remote enabled="false" id="cache-remote-server" saveToRemote="false">
<url>http://localhost:8080</url>
</remote>
<local>
Expand All @@ -37,9 +38,7 @@

<input>
<global>
<glob>
{*.java,*.sh,*.py,*.properties,*.yml,*.yaml,Dockerfile*,*.json,*.xml}
</glob>
<glob>*</glob>
<includes>
<include>src/</include>
<include>docker/</include>
Expand All @@ -49,6 +48,15 @@
<exclude>/dev/null</exclude>
<exclude>target/</exclude>
<exclude>**/*.log</exclude>
<!-- Generated/downloaded frontend trees (e.g. dictionary Quasar app)
that churn every build and would prevent cache hits under glob=* -->
<exclude>**/node_modules/**</exclude>
<exclude>**/frontend/node/**</exclude>
<exclude>**/frontend/.quasar/**</exclude>
<exclude>**/frontend/dist/**</exclude>
<!-- local noise -->
<exclude>**/*.pyc</exclude>
<exclude>**/.DS_Store</exclude>

@ddanielr ddanielr Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that all files are now included with the glob change, the contents of the .git dir should be excluded so the build-cache isn't generating a bunch of hash calculations for things like remote branchs.

Suggested change
<exclude>**/.DS_Store</exclude>
<exclude>**/.DS_Store</exclude>
<!-- Exclude the entire .git directory from hash calculations -->
<exclude>.git</exclude>

</excludes>
</global>
<plugins>
Expand Down Expand Up @@ -167,6 +175,15 @@
<goal>build-info</goal>
</goals>
</goalsList>
<!-- Always (re)assemble the EAR. It is built with a classifier and consumed by
downstream file path (kubernetes-maven-plugin image + assemble tar), so a
cache hit that skips the ear goal leaves no artifact at the expected path. -->
<goalsList artifactId="maven-ear-plugin">
<goals>
<goal>generate-application-xml</goal>
<goal>ear</goal>
</goals>
</goalsList>
<!-- Always run Maven dependency plugin for artifact copying and unpacking -->
<goalsList artifactId="maven-dependency-plugin">
<goals>
Expand Down
2 changes: 1 addition & 1 deletion web-services/deploy/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
<id>wildfly-scripts</id>
<fileSets>
<fileSet>
<directory>{project.build.directory}/wildfly</directory>
<directory>${project.build.directory}/wildfly</directory>
<!-- target/docker/<image path>/build -->
<outputDirectory>.</outputDirectory>
<includes>*.sh</includes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module add --name=com.mysql.driver --dependencies=javax.api,javax.transaction.ap
/subsystem=io/worker=default/:write-attribute(name=task-max-threads,value=${wildfly.io.worker.default.task-max-threads})
/subsystem=io/worker=default/:write-attribute(name=io-threads,value=${wildfly.io.worker.default.io-threads})

#
# test
Comment thread
alerman marked this conversation as resolved.
Outdated
# System properties
#
/system-property=cluster.name:add(value=${cluster.name})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.Logger;
Expand Down Expand Up @@ -80,7 +79,6 @@
import datawave.microservice.query.config.QueryExpirationProperties;
import datawave.microservice.querymetric.BaseQueryMetric;
import datawave.microservice.querymetric.BaseQueryMetric.Prediction;
import datawave.microservice.querymetric.QueryMetric;
import datawave.microservice.querymetric.QueryMetricFactoryImpl;
import datawave.security.authorization.DatawavePrincipal;
import datawave.security.authorization.DatawaveUser;
Expand Down Expand Up @@ -418,52 +416,17 @@ public void testPredict() throws Exception {
when(logic.containsDNWithAccess(dnList)).thenReturn(true);
when(logic.getMaxPageSize()).thenReturn(0);

BaseQueryMetric metric = new QueryMetricFactoryImpl().createMetric();
metric.populate(q);
metric.setQueryType(RunningQuery.class.getSimpleName());

QueryMetric testMetric = new QueryMetric((QueryMetric) metric) {
public static final long serialVersionUID = 7210890100446871775L;

@Override
public boolean equals(Object o) {
// test for equality except for the create date
if (null == o) {
return false;
}
if (this == o) {
return true;
}
if (o instanceof QueryMetric) {
QueryMetric other = (QueryMetric) o;
return new EqualsBuilder().append(this.getQueryId(), other.getQueryId()).append(this.getQueryType(), other.getQueryType())
.append(this.getQueryAuthorizations(), other.getQueryAuthorizations())
.append(this.getColumnVisibility(), other.getColumnVisibility()).append(this.getBeginDate(), other.getBeginDate())
.append(this.getEndDate(), other.getEndDate()).append(this.getCreateDate(), other.getCreateDate())
.append(this.getSetupTime(), other.getSetupTime()).append(this.getUser(), other.getUser())
.append(this.getUserDN(), other.getUserDN()).append(this.getQuery(), other.getQuery())
.append(this.getQueryLogic(), other.getQueryLogic()).append(this.getQueryName(), other.getQueryName())
.append(this.getParameters(), other.getParameters()).append(this.getHost(), other.getHost())
.append(this.getPageTimes(), other.getPageTimes()).append(this.getProxyServers(), other.getProxyServers())
.append(this.getLifecycle(), other.getLifecycle()).append(this.getErrorMessage(), other.getErrorMessage())
.append(this.getErrorCode(), other.getErrorCode()).append(this.getSourceCount(), other.getSourceCount())
.append(this.getNextCount(), other.getNextCount()).append(this.getSeekCount(), other.getSeekCount())
.append(this.getYieldCount(), other.getYieldCount()).append(this.getDocRanges(), other.getDocRanges())
.append(this.getFiRanges(), other.getFiRanges()).append(this.getPlan(), other.getPlan())
.append(this.getVersionMap(), other.getVersionMap()).append(this.getLoginTime(), other.getLoginTime())
.append(this.getPredictions(), other.getPredictions()).isEquals();
} else {
return false;
}

}
};

Set<Prediction> predictions = new HashSet<>();
predictions.add(new Prediction("source", 1));
when(responseObjectFactory.getQueryImpl()).thenReturn(new QueryImpl());
when(logic.getResultLimit(any())).thenReturn(-1L);
when(predictor.predict(eq(testMetric))).thenReturn(predictions);
// The bean builds its own BaseQueryMetric via metricFactory + populate(q), which includes
// environment/time-derived fields. Matching on a hand-built copy with a custom equals() was
// order- and timing-sensitive: when another test class initialized shared global state first
// (e.g. ExtendedQueryExecutorBeanTest), the metrics no longer compared equal, predict()
// returned null, and this test failed intermittently. This test only needs to verify that
// predictQuery echoes the predictor's result, so match any metric.
when(predictor.predict(any(BaseQueryMetric.class))).thenReturn(predictions);

GenericResponse<String> response = bean.predictQuery(queryLogicName, p);

Expand Down
Loading