ayushtkn commented on code in PR #504:
URL: https://github.com/apache/tez/pull/504#discussion_r3340705013
##########
tez-mapreduce/src/test/java/org/apache/tez/mapreduce/processor/map/TestMapProcessor.java:
##########
@@ -197,13 +202,39 @@ public void testMapProcessor() throws Exception {
reader.close();
}
+ /**
+ * A mapper that sleeps briefly every N records to ensure progress updates
+ * can be captured by the test's monitoring thread.
+ */
+ public static class SlowMapper extends MapReduceBase
+ implements Mapper<LongWritable, Text, LongWritable, Text> {
+ private static final int N = 100;
+ private final AtomicInteger counter = new AtomicInteger(0);
+
+ @Override
+ public void map(LongWritable key, Text value,
+ OutputCollector<LongWritable, Text> output, Reporter reporter)
+ throws IOException {
+ output.collect(key, value);
+ if (counter.incrementAndGet() % N == 0) {
+ try {
+ Thread.sleep(1);
Review Comment:
This will not fix it I believe, it will increase the probability of it
passing I believe. Can we wait in the Test's monitoring thread for some X
condition instead? Like maybe using `GenericTestUtils.waitFor()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]