Skip to content

Selftest 340 flakes once in 4096 runs: an unreadable pg_config's stamp key keeps 3 hex characters #1478

Closed

Description

@jdatcmd

The bug

pgc_source_stamp_path (test/lib.sh) keys an unreadable pg_config's build stamp on md5(path), cut to 3 hex characters:

_pgc_sp_id="nolib$(printf '%s' "$_pgc_sp_cfg" | md5sum | cut -c1-3)"

That is 4096 values. Selftest 340's check "two unreadable pg_configs do not alias onto one stamp" builds its two broken pg_configs in a random mktemp directory, so they collide about once in 4096 runs. #1476's suites (PG 18) job hit one (run 38855440878):

>> FAIL  two unreadable pg_configs do not alias onto one stamp: got [SAME] want [different]

The same head passed twice locally.

Reproduced deterministically with lib.sh's own function. In /tmp/pgc-collide-870, pg_config.broken and pg_config.broken2 both get /tree/.pgc_source_stamp.0.nolib235: SAME. At 8 characters they differ (23593d63 against 2356c898). The readable branch already keeps 8 characters.

Fix

Keep 8 characters in the nolib branch. Add a selftest arm that uses those two colliding paths, so the property is tested every run, not once in 4096.

🤖 Generated with Claude Code

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