fsprojects / FSharp.Data.Adaptive

On-demand adaptive/incremental data for F# https://fsprojects.github.io/FSharp.Data.Adaptive/
MIT License
250 stars 24 forks source link

applyDelta Test fails rarely #94

Closed krauthaufen closed 2 years ago

krauthaufen commented 3 years ago

See https://github.com/fsprojects/FSharp.Data.Adaptive/actions/runs/1438879548

luithefirst commented 3 years ago

I can reproduce that locally, but it does not make sense to me. Similar to the case that fails in the log, I get an error while the input was an empty set and a map with 3 deltas. When I try to reproduce it by hardcoding the inputs of the test to those values, it passes.

"inconsistent count 2 vs 1" means that the Set (reference) has 2 and the HashSet has 1 -> when looking at the input it would mean that the HashSet is broken, assuming the correct output should be [23; 407].

krauthaufen commented 3 years ago

Thanks for looking into that, i'll have time for this tomorrow, so I'll try to find it...

krauthaufen commented 3 years ago

It must be a pretty rare case, since fscheck almost never finds it...

luithefirst commented 3 years ago

It turns out I was confused by the output, the test seems to run all 100 cases and I thought the last "output" (own printfn stuff) is from the failed test. Using this input causes the test to fail:

    let s = Set.empty
    let d = Map.ofList [({ value = 3 }, -6); ({ value = 99 }, -38); ({ value = 131 }, 47)]

    // -> output: 1 vs 0

    set [{ value = 131 }]
    HashSet []
krauthaufen commented 3 years ago

Thanks, that'll help finding the problem

luithefirst commented 3 years ago

and also let d = Map.ofList [({ value = 23 }, 1); ({ value = 87 }, -1); ({ value = 407 }, 1)] as in the log you posted