Repository: aurora
Updated Branches:
  refs/heads/master c05632b21 -> cbe99f547


Remove flaky test/assertion in PendingTaskProcessorTest

I realized I added a flaky assertion in `PendingTaskProcessorTest` in
https://reviews.apache.org/r/66536/

I got extremely unlucky and every time I ran the tests it passed until after
I merged :( The stat `preemptor_slot_search_[success|failed]_for_[name]` will
not appear unless the job slot search actually succeeds or fails (i.e. it
cannot be 0 since it is dynamically generated). We were getting lucky where the
test would search for JOB_A slots first and create the stat. However, when
JOB_B gets searched first, the JOB_A stat is never created because there are no
slaves to search through anymore.

I removed the assertion because there is a sufficient assertion directly above,
and the stat is tested in multiple other tests.

The assertion would result in a `NullPointerException`.

Reviewed at https://reviews.apache.org/r/66570/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/cbe99f54
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/cbe99f54
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/cbe99f54

Branch: refs/heads/master
Commit: cbe99f547c562a56ae800991105fb2060387776e
Parents: c05632b
Author: Jordan Ly <jordan....@gmail.com>
Authored: Wed Apr 11 16:46:59 2018 -0700
Committer: Jordan Ly <j...@twitter.com>
Committed: Wed Apr 11 16:46:59 2018 -0700

----------------------------------------------------------------------
 .../aurora/scheduler/preemptor/PendingTaskProcessorTest.java       | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/cbe99f54/src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java
 
b/src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java
index 0bd8d21..82b7aee 100644
--- 
a/src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java
+++ 
b/src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java
@@ -224,8 +224,6 @@ public class PendingTaskProcessorTest extends EasyMockTest {
     // evaluated first.
     assertTrue(ImmutableSet.of(0L, 2L).contains(
         statsProvider.getLongValue(slotSearchStatName(false, true))));
-    assertTrue(ImmutableSet.of(0L, 2L).contains(
-        statsProvider.getLongValue(slotSearchByJobStatName(false, JOB_A))));
     assertEquals(1L, statsProvider.getLongValue(UNMATCHED_TASKS));
     assertEquals(2L, statsProvider.getLongValue(CACHE_SIZE_STAT_NAME));
   }

Reply via email to