Package hudson.model.queue

Examples of hudson.model.queue.CauseOfBlockage$BecauseNodeIsOffline


                "refs/changes/1/1/1", dateBefore8Hours);
        Item item = createItem(changeMerged, new String[] {"slaveA"});

        // item is NOT blocked since patchset createdOn date is older than cache
        // we assume it was
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNull("The item should NOT be blocked", cause);

    }
View Full Code Here


                "refs/changes/1/1/1", dateBefore1Hours);
        Item item = createItem(changeMerged, new String[] {"slaveA"});

        // item is NOT blocked since patchset createdOn date is older than cache
        // we assume it was
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNull("The item should NOT be blocked", cause);

    }
View Full Code Here

                "refs/changes/1/1/1", dateBefore8Hours);
        Item item = createItem(dp, new String[] {"slaveA"});

        // item is NOT blocked since patchset createdOn date is older than cache
        // we assume it was
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNull("The item should NOT be blocked", cause);

    }
View Full Code Here

    private void patchSetIsReplicatedToOneSlaveAfterChangeBasedEvent(ChangeBasedEvent cbe) {

        Item item = createItem(cbe, new String[] {"slaveA"});

        //item is blocked
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("The item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));

        //send an unrelated event (not RefReplicated)
        dispatcher.gerritEvent(new ChangeAbandoned());
        assertNotNull("the item should be blocked", dispatcher.canRun(item));
View Full Code Here

        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
                "refs/changes/1/1/1");
        Item item = createItem(patchsetCreated, new String[] {"slaveA", "slaveB", "slaveC"});

        //item is blocked
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));
        assertTrue(cause.getShortDescription().contains("slaveB"));
        assertTrue(cause.getShortDescription().contains("slaveC"));

        //send replication event for slaveB
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveB", RefReplicated.SUCCEEDED_STATUS));

        //item is still blocked
        cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));
        assertFalse(cause.getShortDescription().contains("slaveB"));
        assertTrue(cause.getShortDescription().contains("slaveC"));

        //send replication event for slaveA
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveA", RefReplicated.SUCCEEDED_STATUS));

        //item is still blocked
        cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertFalse(cause.getShortDescription().contains("slaveA"));
        assertFalse(cause.getShortDescription().contains("slaveB"));
        assertTrue(cause.getShortDescription().contains("slaveC"));

        //send replication event for slaveC
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveC", RefReplicated.SUCCEEDED_STATUS));
View Full Code Here

        gerritSlaves.add(new GerritSlave("slave1", "host1", 0));
        gerritSlaves.add(new GerritSlave("slave2", "host2", 1)); // slave timeout is 1 second
        when(gerritTriggerMock.gerritSlavesToWaitFor("someGerritServer")).thenReturn(gerritSlaves);

        //item is blocked
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slave1"));
        assertTrue(cause.getShortDescription().contains("slave2"));

        //wait to reach the timeout
        Thread.sleep(TimeUnit.SECONDS.toMillis(2));

        //timeout reached
View Full Code Here

        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
                "refs/changes/1/1/1");
        Item item = createItem(patchsetCreated, new String[] {"slaveA", "slaveB", "slaveC"});

        //item is blocked
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));
        assertTrue(cause.getShortDescription().contains("slaveB"));
        assertTrue(cause.getShortDescription().contains("slaveC"));

        //send replication event for slaveB
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveB", RefReplicated.SUCCEEDED_STATUS));

        //item is still blocked
        cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));
        assertFalse(cause.getShortDescription().contains("slaveB"));
        assertTrue(cause.getShortDescription().contains("slaveC"));

        //send failed replication event for slaveA
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveA", RefReplicated.FAILED_STATUS));

        //send replication event for slaveC
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveC", RefReplicated.SUCCEEDED_STATUS));

        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));

        //send success replication event for slaveA
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveA", RefReplicated.SUCCEEDED_STATUS));
View Full Code Here

        RefUpdated refUpdated = Setup.createRefUpdated("someGerritServer", "someProject",
                "master");
        Item item = createItem(refUpdated, new String[] {"slaveA", "slaveB"});

        //item is blocked since the cached replication events are time stamped before the actual event
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        assertTrue(cause.getShortDescription().contains("slaveA"));
        assertTrue(cause.getShortDescription().contains("slaveB"));

        //send replication events created after the actual event
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/heads/master", "someGerritServer",
                "slaveB", RefReplicated.SUCCEEDED_STATUS));
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/heads/master", "someGerritServer",
View Full Code Here

                "refs/changes/1/1/1");
        Item item1 = createItem(patchsetCreated, new String[] {"slaveA"});
        Item item2 = createItem(patchsetCreated, new String[] {"slaveA"});

        //items are blocked
        CauseOfBlockage cause = dispatcher.canRun(item1);
        assertNotNull("the item should be blocked", cause);
        assertTrue("Should have returned a WaitingForReplication as CauseOfBlockage",
                cause instanceof WaitingForReplication);
        cause = dispatcher.canRun(item2);
        assertNotNull("the item should be blocked", cause);
View Full Code Here

TOP

Related Classes of hudson.model.queue.CauseOfBlockage$BecauseNodeIsOffline

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.