Skip to content

Commit f4f00fb

Browse files
hpoettkerfmbenhassine
authored andcommitted
Synchronize reader for multithreaded test
1 parent 5bdba93 commit f4f00fb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRollbackTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -549,6 +549,12 @@ void testSkipInWriterTransactionalReader() throws Exception {
549549

550550
@Test
551551
void testMultithreadedSkipInWriter() throws Exception {
552+
factory.setItemReader(new ItemReader<>() {
553+
@Override
554+
public synchronized String read() throws Exception {
555+
return reader.read();
556+
}
557+
});
552558
writer.setFailures("1", "2", "3", "4", "5");
553559
factory.setCommitInterval(3);
554560
factory.setSkipLimit(10);

0 commit comments

Comments
 (0)