Skip to content

InstanceChangeThrottler_Test

class InstanceChangeThrottler_Test : public CPPUNIT_NS::TestFixture

Functions

Name Description
testThrottleInterval Test that the "bursts" of event changes received from the throttler are propertly spaced in time.
testNewGoneOptimization Test the throttler optimization for New->[Update]->Gone changes for the same instanceId - the throttler is expected to "consume" those sequences if they're still waiting to be dispatched.
testNewUpdateOptimization Test the throttler optimization for New->Update changes for the same instanceId - the throttler is expected to keep just the New with its "payload" overwritten by the payload of the Update.
testUpdateNewOptimization Test the throttler optimization for Update->New changes without an (expected) intermediary Gone change.
testUpdateOptimization Test the throttler optimization for multiple Update changes for the same instanceId - the throttler is expected to keep just the one (the most recent) update change for an instanceId in its dispatch queue.
testNewGoneOptimization2Cycles Test that the throttler optimization for New->[Update]->Gone changes for the same instanceId does not happen if the changes are dispatched in different cycles of the throttler.
testUpdateOptimization2Cycles Test that the throttler optimization for multiple Update changes for the same instanceId does not happen if the changes are dispatched in different cycles of the throttler.
testMaxChangesPerCycle Test that the limit of maximum changes per cycle is really preempting the interval between cycles for the throttler.
testBigUpdateSequence Tests a big update sequence that should extend for multiple throttler cycles.
testThrottlerLifecycle Tests the stability of the throttler across its lifecycle.
testChangesWithFlushes Tests the stability of the throttler across multiple flushes requests in the middle of a large sequence of changes.

Function Details

testBigUpdateSequence

void testBigUpdateSequence()

Tests a big update sequence that should extend for multiple throttler cycles. This is a stress test aimed at exposing internal data race conditions inside the throttler.

testChangesWithFlushes

void testChangesWithFlushes()

Tests the stability of the throttler across multiple flushes requests in the middle of a large sequence of changes. To pass this test the throttler must be able to dispatch all the submitted instance changes. The alternation between flushes and dispatches from the normal throttler cycle must not compromisse the dispatches.

testMaxChangesPerCycle

void testMaxChangesPerCycle()

Test that the limit of maximum changes per cycle is really preempting the interval between cycles for the throttler.

testNewGoneOptimization

void testNewGoneOptimization()

Test the throttler optimization for New->[Update]->Gone changes for the same instanceId - the throttler is expected to "consume" those sequences if they're still waiting to be dispatched.

testNewGoneOptimization2Cycles

void testNewGoneOptimization2Cycles()

Test that the throttler optimization for New->[Update]->Gone changes for the same instanceId does not happen if the changes are dispatched in different cycles of the throttler.

testNewUpdateOptimization

void testNewUpdateOptimization()

Test the throttler optimization for New->Update changes for the same instanceId - the throttler is expected to keep just the New with its "payload" overwritten by the payload of the Update.

testThrottleInterval

void testThrottleInterval()

Test that the "bursts" of event changes received from the throttler are propertly spaced in time.

testThrottlerLifecycle

void testThrottlerLifecycle()

Tests the stability of the throttler across its lifecycle. To pass this test the throttler must be able to always flush the instance changes it has stored internally before being destructed.

testUpdateNewOptimization

void testUpdateNewOptimization()

Test the throttler optimization for Update->New changes without an (expected) intermediary Gone change. The expected outcome is for the Update change to be removed and the New change to be added.

testUpdateOptimization

void testUpdateOptimization()

Test the throttler optimization for multiple Update changes for the same instanceId - the throttler is expected to keep just the one (the most recent) update change for an instanceId in its dispatch queue.

testUpdateOptimization2Cycles

void testUpdateOptimization2Cycles()

Test that the throttler optimization for multiple Update changes for the same instanceId does not happen if the changes are dispatched in different cycles of the throttler.