Skip to content

26.1: ClientGameTest hangs upon disconnecting the world #5277

@YaLTeR

Description

@YaLTeR

Reproducer on top of fabric-example-mod:

package com.example.test;

import net.fabricmc.fabric.api.client.gametest.v1.FabricClientGameTest;
import net.fabricmc.fabric.api.client.gametest.v1.context.ClientGameTestContext;
import net.fabricmc.fabric.api.client.gametest.v1.context.TestSingleplayerContext;

public class HangReproducerTest implements FabricClientGameTest {
    @Override
    public void runTest(ClientGameTestContext context) {
        // Simply creating and closing a singleplayer world hangs.
        try (TestSingleplayerContext world = context.worldBuilder().create()) {
            world.getClientLevel().waitForChunksDownload();
        }
    }
}
sourceSets {
        testmodClient {
                compileClasspath += main.compileClasspath + main.output + client.output
                runtimeClasspath += main.runtimeClasspath + main.output + client.output
        }
}

loom {
        runs {
                clientGametest {
                        client()
                        ideConfigGenerated true
                        name "Client Game Test"
                        source sourceSets.testmodClient
                        vmArg "-Dfabric.client.gametest"
                }
        }
}

Then, ./gradlew runClientGametest will do everything successfully, then hang when the world is supposed to be disconnected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions