Skip to content

exec-harness: benchmark URI built from pre-truncation name #368

Description

@tusharhqq

What I observed

For a long explicit benchmark name, generate_name_and_uri returns a truncated name, but the returned uri still contains the full untruncated name.

The result I observed for a 2000-character name was:

name.len() = 924
uri.len() = 2014
uri == format!("exec_harness::{}", name) = false

Reproduction

The behavior is in crates/exec-harness/src/uri.rs.

Minimal direct check:

let name = Some("x".repeat(2000));
let command = vec!["true".to_string()];
let result = generate_name_and_uri(&name, &command);

assert_eq!(result.name.len(), 924);
assert_eq!(result.uri, format!("exec_harness::{}", result.name));

The final assertion fails because result.uri is built from the longer input name.

Expected behavior

If the benchmark name is truncated, I expected the returned URI to match the returned name:

uri == format!("exec_harness::{}", name)

Actual behavior

The returned name and uri disagree for long explicit names.

I have not verified whether this causes a user-visible failure after upload; the hard fact I observed is the mismatch above.

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