Home / Function/ testRaceCondition() — netty Function Reference

testRaceCondition() — netty Function Reference

Architecture documentation for the testRaceCondition() function in NonStickyEventExecutorGroupTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1eacf891_c5e9_622e_43c4_60bd21c51c50["testRaceCondition()"]
  d2c2f535_6e38_2696_75d2_7afac99b078a["NonStickyEventExecutorGroupTest"]
  1eacf891_c5e9_622e_43c4_60bd21c51c50 -->|defined in| d2c2f535_6e38_2696_75d2_7afac99b078a
  d369a955_11b2_c7ca_40f7_c70d0810e451["execute()"]
  1eacf891_c5e9_622e_43c4_60bd21c51c50 -->|calls| d369a955_11b2_c7ca_40f7_c70d0810e451
  style 1eacf891_c5e9_622e_43c4_60bd21c51c50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java lines 106–134

    @ParameterizedTest(name = PARAMETERIZED_NAME)
    @MethodSource("data")
    public void testRaceCondition(int maxTaskExecutePerRun) throws InterruptedException {
        EventExecutorGroup group = new UnorderedThreadPoolEventExecutor(1);
        NonStickyEventExecutorGroup nonStickyGroup = new NonStickyEventExecutorGroup(group, maxTaskExecutePerRun);

        try {
            EventExecutor executor = nonStickyGroup.next();

            for (int j = 0; j < 5000; j++) {
                final CountDownLatch firstCompleted = new CountDownLatch(1);
                final CountDownLatch latch = new CountDownLatch(2);
                for (int i = 0; i < 2; i++) {
                    executor.execute(new Runnable() {
                        @Override
                        public void run() {
                            firstCompleted.countDown();
                            latch.countDown();
                        }
                    });
                    assertTrue(firstCompleted.await(1, TimeUnit.SECONDS));
                }

                assertTrue(latch.await(5, TimeUnit.SECONDS));
            }
        } finally {
            nonStickyGroup.shutdownGracefully();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testRaceCondition() do?
testRaceCondition() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java.
Where is testRaceCondition() defined?
testRaceCondition() is defined in common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java at line 106.
What does testRaceCondition() call?
testRaceCondition() calls 1 function(s): execute.

Analyze Your Own Codebase

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

Try Supermodel Free