Skip to content

Provide a way to generate shorter tempdir paths #15

@wiktor-k

Description

@wiktor-k

Hi,

I wanted to use tempdir to generate a Unix socket path for tests and just found out that they have stricter length limits than regular file names (108 on linux).

An excerpt from my logs:

Starting server on 127.0.0.1:41661; agent on "/home/wiktor/tmp/cargo/testdir-20/ssh_roundtrip/start_ssh_server_connect_and_check_result_of_signing/agent.sock"
...
thread 'start_ssh_server_connect_and_check_result_of_signing' panicked at signstar-request-signature/tests/ssh-roundtrip.rs:181:40:
error: std::io::error::Error - path must be shorter than SUN_LEN

("/home/wiktor/tmp/cargo/testdir-20/ssh_roundtrip/start_ssh_server_connect_and_check_result_of_signing/agent.sock" has 111 characters).

A workaround is to use shorter test names but sadly the path to the temp file varies between my local computer and the CI and this kind of workaround is basically a bomb that may go off any time.

It'd be good to be able to generate shorter, but still unique, paths with testdir.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions