dongjoon-hyun commented on code in PR #831:
URL:
https://github.com/apache/spark-kubernetes-operator/pull/831#discussion_r4028099684
##########
spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/EventUtilsTest.java:
##########
@@ -60,6 +63,44 @@ void warnKeysTheEventOnReasonSoRepeatsAggregate() {
assertThat(event.key()).contains(EventUtils.REASON_STATUS_UPDATE_FAILED);
}
+ @Test
+ void recordPublishesTheGivenType() {
+ EventUtils.record(recorder, EventType.NORMAL, "DriverRequested", "driver
requested");
+
+ ArgumentCaptor<EventRecord> captor =
ArgumentCaptor.forClass(EventRecord.class);
+ verify(recorder).record(captor.capture());
+ EventRecord event = captor.getValue();
+ assertThat(event.type()).isEqualTo(EventType.NORMAL);
+ assertThat(event.reason()).isEqualTo("DriverRequested");
+ assertThat(event.message()).isEqualTo("driver requested");
+ assertThat(event.key()).contains("DriverRequested");
+ }
+
+ @Test
+ void eventTypeOfApplicationStates() {
+ for (ApplicationStateSummary summary : ApplicationStateSummary.values()) {
+ EventType expected =
Review Comment:
Thank you, @peter-toth. I updated both tests to pin the documented table
with explicit sets, and verified that dropping `DriverEvicted` from
`ApplicationStateSummary.failures` now fails `eventTypeOfApplicationStates`.
##########
spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/EventUtils.java:
##########
@@ -53,8 +58,28 @@ public final class EventUtils {
/** Maximum number of links followed when looking for the innermost cause of
a failure. */
private static final int MAX_CAUSE_DEPTH = 10;
+ /** States that are not failures but still deserve the attention of users. */
Review Comment:
Thank you. I added the rule to the Javadoc of `NON_FAILURE_WARNING_STATES`,
including why `TerminatedWithoutReleaseResources` is a warning (it is not meant
for production use).
--
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]