Skip to content

Sporadic test failures due to out of bounds errors #91

Closed
@maximus1108

Description

@maximus1108

The problem

When running tests for Shopify Functions with cargo test, they sporadically fail with out of bounds errors:

~/cargo/registry/src/index.crates.io-6f17d22bba15001f/shopify_function_provider-1.0.1/src/string_interner.rs:26:39:
index out of bounds: the len is 81 but the index is 84
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This does not happen when running a single test or when running the tests with a single thread (via cargo test -- --test-threads=1), so there is seemingly a race condition.

The specific function we were experiencing issues with can be found in my PR where I also update calls to cargo test to use --test-threads=1 to work around this issue temporarily. The issue should be easy to reproduce when running tests for that function.

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