Home / Function/ testAdvanceTime() — netty Function Reference

testAdvanceTime() — netty Function Reference

Architecture documentation for the testAdvanceTime() function in EmbeddedChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4f77b754_092e_e4c3_5162_19ffee6d25b5["testAdvanceTime()"]
  300cabef_b042_697f_5623_37ce249f504d["EmbeddedChannelTest"]
  4f77b754_092e_e4c3_5162_19ffee6d25b5 -->|defined in| 300cabef_b042_697f_5623_37ce249f504d
  style 4f77b754_092e_e4c3_5162_19ffee6d25b5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java lines 667–687

    @Test
    @Timeout(30) // generous timeout, just make sure we don't actually wait for the full 10 mins...
    void testAdvanceTime() {
        EmbeddedChannel channel = new EmbeddedChannel();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
            }
        };
        ScheduledFuture<?> future10 = channel.eventLoop().schedule(runnable, 10, TimeUnit.MINUTES);
        ScheduledFuture<?> future20 = channel.eventLoop().schedule(runnable, 20, TimeUnit.MINUTES);

        channel.runPendingTasks();
        assertFalse(future10.isDone());
        assertFalse(future20.isDone());

        channel.advanceTimeBy(10, TimeUnit.MINUTES);
        channel.runPendingTasks();
        assertTrue(future10.isDone());
        assertFalse(future20.isDone());
    }

Domain

Subdomains

Frequently Asked Questions

What does testAdvanceTime() do?
testAdvanceTime() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java.
Where is testAdvanceTime() defined?
testAdvanceTime() is defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java at line 667.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free