paul-rogers commented on code in PR #13726:
URL: https://github.com/apache/druid/pull/13726#discussion_r1092451508
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQInsertTest.java:
##########
@@ -99,6 +99,40 @@ public void testInsertOnFoo1()
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(expectedFooSegments())
.setExpectedResultRows(expectedFooRows())
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().totalFiles(1)
+ .buildChannelCounter(),
+ 0, 0, "input0"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(5).bytes(251).frames(1)
+ .buildChannelCounter(),
+ 0, 0, "shuffle"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(5).bytes(251).frames(1)
+ .buildChannelCounter(),
+ 1, 0, "input0"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(1, 1, 1, 1, 1).bytes(92, 89, 89, 91,
91).frames(1, 1, 1, 1, 1)
Review Comment:
Also, suppose that things do change and we get a bunch of failures. Is it
clear to the poor developer what the new numbers should be? Or, do we have to
debug each test, figure out the new numbers, and manually update the code? That
will be painful. Is there a better way?
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQInsertTest.java:
##########
@@ -99,6 +99,40 @@ public void testInsertOnFoo1()
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(expectedFooSegments())
.setExpectedResultRows(expectedFooRows())
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().totalFiles(1)
+ .buildChannelCounter(),
+ 0, 0, "input0"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(5).bytes(251).frames(1)
+ .buildChannelCounter(),
+ 0, 0, "shuffle"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(5).bytes(251).frames(1)
+ .buildChannelCounter(),
+ 1, 0, "input0"
+ )
+ .setExpectedCountersForStageWorkerChannel(
+ CounterSnapshotBuilder
+ .with().rows(1, 1, 1, 1, 1).bytes(92, 89, 89, 91,
91).frames(1, 1, 1, 1, 1)
Review Comment:
This kind of thing is _very_ fragile. Make a simple change to the frame
format, say, and the byte counts change. Is there a better way to ensure that
the counters are updated without creating a fragile test?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]