Skip to content

Setting ryuk.container.timeout causes a ClassCastException #684

@jamieswogger

Description

@jamieswogger

Tried setting ryuk.container.timeout by creating a testcontainers.properties that contains the following:

ryuk.container.timeout=120

This is successfully picked up, but when TestcontainersConfiguration#getRyukTimeout is called is calls properties.getOrDefault, which returns a string "120" which is attempted to be cast to an Integer. This results in the following error:

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

A fix for this is to change TestcontainersConfiguration#getRyukTimeout to

public Integer getRyukTimeout() {
    return Integer.parseInt((String) properties.getOrDefault("ryuk.container.timeout", "30"));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions