smengcl commented on code in PR #6155:
URL: https://github.com/apache/ozone/pull/6155#discussion_r1486837356
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java:
##########
@@ -321,15 +322,20 @@ abstract class Builder {
protected Optional<Integer> hbProcessorInterval = Optional.empty();
protected String scmId = UUID.randomUUID().toString();
protected String omId = UUID.randomUUID().toString();
-
+
protected Optional<String> datanodeReservedSpace = Optional.empty();
protected boolean includeRecon = false;
-
protected Optional<Integer> omLayoutVersion = Optional.empty();
protected Optional<Integer> scmLayoutVersion = Optional.empty();
protected Optional<Integer> dnLayoutVersion = Optional.empty();
+ protected int dnInitialVersion =
DatanodeVersion.FUTURE_VERSION.toProtoValue();
+ protected int dnCurrentVersion =
DatanodeVersion.FUTURE_VERSION.toProtoValue();
Review Comment:
Yeah I was using current version before, where I mock static regardless of
whether `setCurrentVersion()` is called or not. But that was failing in some
specific tests, namely `TestMiniChaosOzoneCluster` and the ones extending it,
which don't like mock static:
```
The used MockMaker SubclassByteBuddyMockMaker does not support the creation
of static mocks
```
https://github.com/apache/ozone/actions/runs/7838323143/job/21389974604?pr=6155#step:6:261
So I worked
[around](https://github.com/apache/ozone/pull/6155/commits/7d16cfeaa0d04659ef618744f4b535c026891cae)
it by using future version `-1` as a flag indicating the value hasn't been
changed. I was also using `Optional` in an earlier revision of this PR but I
removed it.
--
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]