Skip to content

Commit

Permalink
Merge pull request #377 from jberet/dependabot/maven/io.netty-netty-a…
Browse files Browse the repository at this point in the history
…ll-4.1.99.Final

Bump io.netty:netty-all from 4.1.98.Final to 4.1.99.Final
  • Loading branch information
liweinan authored Oct 5, 2023
2 parents 6d066b6 + 5e37375 commit 4eb3578
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<version.jakarta.jms-api>3.1.0</version.jakarta.jms-api>
<version.org.jboss.spec.javax.jms.jboss-jms-api_2.0_spec>2.0.0.Final</version.org.jboss.spec.javax.jms.jboss-jms-api_2.0_spec>
<version.io.netty>4.1.98.Final</version.io.netty>
<version.io.netty>4.1.99.Final</version.io.netty>

<version.jakarta.validation-api>3.0.0</version.jakarta.validation-api>
<version.org.hibernate.validator>8.0.0.CR1</version.org.hibernate.validator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.jberet.testapps.chunkstop;

import java.util.Properties;

import jakarta.batch.operations.JobRestartException;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.Metric;
Expand Down Expand Up @@ -40,19 +41,19 @@ public void after() {

@Test
public void chunkStopRestart() throws Exception {
params.setProperty("writer.sleep.time", "500");
params.setProperty("writer.sleep.time", "1000");
params.setProperty("restartable", Boolean.TRUE.toString());
startJob(jobXml);
jobOperator.stop(jobExecutionId);
awaitTermination();
Assert.assertEquals(BatchStatus.STOPPED, jobExecution.getBatchStatus());

Assert.assertEquals(true, stepExecutions.size() == 0 || stepExecutions.size() == 1);
Assert.assertEquals(true, stepExecutions.size() < dataCount);

if(stepExecutions.size() == 1) {
if (stepExecutions.size() == 1) {
//since we called stop right after start, and the writer sleeps before writing data, there should only be 1 write and commit
Assert.assertEquals(1, MetricImpl.getMetric(stepExecution0, Metric.MetricType.WRITE_COUNT));
Assert.assertEquals(1, MetricImpl.getMetric(stepExecution0, Metric.MetricType.COMMIT_COUNT));
Assert.assertTrue(MetricImpl.getMetric(stepExecution0, Metric.MetricType.WRITE_COUNT) < dataCount);
Assert.assertTrue(MetricImpl.getMetric(stepExecution0, Metric.MetricType.COMMIT_COUNT) < dataCount);
}

restartAndWait();
Expand Down Expand Up @@ -92,6 +93,7 @@ public void restartJobParameters() throws Exception {

/**
* Verifies that restarting with null job parameters should work without causing {@code NullPointerException}.
*
* @throws Exception
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ protected void initData() {
for (int i = 0; i < dataCount; i++) {
data[i] = i;
}

System.out.printf("init data: %s%n", Arrays.toString(data));

//position the cursor according to partition start
cursor = partitionStart;
System.out.printf("Partition start = %s, end = %s in %s%n", partitionStart, partitionEnd, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void writeItems(final List<Object> items) throws Exception {
}

if (writerSleepTime > 0) {
System.out.printf("writerSleepTime: %s millis%n", writerSleepTime);
Thread.sleep(writerSleepTime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.jberet.testapps.common.AbstractIT;

public abstract class PurgeRepositoryTestBase extends AbstractIT {
protected static final long purgeSleepMillis = 2000;
protected static final long purgeSleepMillis = 2000 * 2;
protected static final String prepurgeJobName = "prepurge";
protected static final String prepurge2JobName = "prepurge2";
protected static final String prepurgeAndPrepurge2JobNames = "prepurge, prepurge2";
Expand Down

0 comments on commit 4eb3578

Please sign in to comment.