Skip to content

The test_within_radius test sometimes fails. #1

Open
@kennytm

Description

@kennytm

The failure rate is around 6% (3 in 50) on macOS. The failing items all have the form [4,3,5,2,6,x,x,x].

Example test cases:

(1)

---- test::test_within_radius stdout ----
	Tree: VpTree { len: 8 }
Items: [4, 3, 5, 2, 6, 7, 1, 0]
Structure:
[ 4(2) ] 
[ 3(1) 7(1) ] 
[ 5(1) 6(0) ] [ 1(1) _ ] 
[ 2(0) _ ] [ _ _ ] [ 0(0) _ ] [ _ _ ] 

Within radius (2): [Neighbor { item: 4, dist: 0 }, Neighbor { item: 3, dist: 1 }, Neighbor { item: 5, dist: 1 }, Neighbor { item: 6, dist: 2 }, Neighbor { item: 2, dist: 2 }, Neighbor { item: 7, dist: 3 }]
thread 'test::test_within_radius' panicked at 'Was not expecting Neighbor { item: 7, dist: 3 }', src/lib.rs:508:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.

(2)

---- test::test_within_radius stdout ----
	Tree: VpTree { len: 8 }
Items: [4, 3, 5, 2, 6, 1, 7, 0]
Structure:
[ 4(2) ] 
[ 3(1) 1(1) ] 
[ 5(1) 6(0) ] [ 7(1) _ ] 
[ 2(0) _ ] [ _ _ ] [ 0(0) _ ] [ _ _ ] 

Within radius (2): [Neighbor { item: 4, dist: 0 }, Neighbor { item: 3, dist: 1 }, Neighbor { item: 5, dist: 1 }, Neighbor { item: 6, dist: 2 }, Neighbor { item: 2, dist: 2 }, Neighbor { item: 1, dist: 3 }]
thread 'test::test_within_radius' panicked at 'Was not expecting Neighbor { item: 1, dist: 3 }', src/lib.rs:508:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.

(3)

---- test::test_within_radius stdout ----
	Tree: VpTree { len: 8 }
Items: [4, 3, 5, 2, 6, 0, 1, 7]
Structure:
[ 4(2) ] 
[ 3(1) 0(1) ] 
[ 5(1) 6(0) ] [ 1(1) _ ] 
[ 2(0) _ ] [ _ _ ] [ 7(0) _ ] [ _ _ ] 

Within radius (2): [Neighbor { item: 4, dist: 0 }, Neighbor { item: 3, dist: 1 }, Neighbor { item: 5, dist: 1 }, Neighbor { item: 6, dist: 2 }, Neighbor { item: 2, dist: 2 }, Neighbor { item: 1, dist: 3 }]
thread 'test::test_within_radius' panicked at 'Was not expecting Neighbor { item: 1, dist: 3 }', src/lib.rs:508:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Tested with vec-vp-tree = "0.2.0-alpha.1" on crates.io.

$ rustc -vV
rustc 1.21.0-nightly (e26688824 2017-08-27)
binary: rustc
commit-hash: e2668882406b68739c6ed33d420358d5d710e67b
commit-date: 2017-08-27
host: x86_64-apple-darwin
release: 1.21.0-nightly
LLVM version: 4.0

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