-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64523/#review193491
-----------------------------------------------------------



I should have looked more closely at the last patch, and when preparing my 
patch before that.  This test is bound to be flaky since there's nothing 
ensuring a happens-before releationship between issuing the request and 
checking the result.

I can repro consistently with the patch below, slowing down the `onThrowable` 
handler:
```console
$ git diff
diff --git a/src/main/java/org/apache/aurora/scheduler/events/Webhook.java 
b/src/main/java/org/apache/aurora/scheduler/events/Webhook.java
index 95e3f52..d4519ee 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/Webhook.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/Webhook.java
@@ -102,6 +102,10 @@ public class Webhook extends AbstractIdleService 
implements EventSubscriber {
         createRequest(stateChange).execute(new 
AsyncCompletionHandler<Integer>() {
           @Override
           public void onThrowable(Throwable t) {
+            try {
+              Thread.sleep(1000);
+            } catch (InterruptedException e) {
+            }
             errorsCounter.incrementAndGet();
             LOG.error("Error sending a Webhook event", t);
```

If i get some spare time, i may take a stab at a fix; but the happens-before is 
what we'll want to seek.

- Bill Farner


On Dec. 11, 2017, 6:29 p.m., Jordan Ly wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64523/
> -----------------------------------------------------------
> 
> (Updated Dec. 11, 2017, 6:29 p.m.)
> 
> 
> Review request for Aurora and Stephan Erb.
> 
> 
> Bugs: AURORA-1961
>     https://issues.apache.org/jira/browse/AURORA-1961
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Attempt #2 to fix the flaky Webhook test.
> 
> Along the same lines of Stephan's change 
> (https://reviews.apache.org/r/64482/), but opting to never start the Jetty 
> server and forcing a connect exception.
> 
> Overall, this flakiness has seemed to increase in volume over the past month. 
> I've been running into it with a noticable fraction of internal/test builds.
> 
> 
> Diffs
> -----
> 
>   src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java 
> 1b5d2d02535345edfe6cf04d18d00434393f800b 
> 
> 
> Diff: https://reviews.apache.org/r/64523/diff/1/
> 
> 
> Testing
> -------
> 
> This change seems pretty hard to test considering the differences in 
> environment and the unknown cause of the actual errors. Maybe we run the 
> reviewbot on this repo repeatedly? Obviously not the most scientifically 
> sound solution.
> 
> 
> Thanks,
> 
> Jordan Ly
> 
>

Reply via email to