akka-samples
akka-samples copied to clipboard
sample.distributeddata.ShoppingCartSpec: must handle updates from different nodes
[JVM-3] - must handle updates from different nodes *** FAILED ***
[JVM-3] Set(LineItem [productId=1, title=Apples, quantity=7]) was not equal to Set(LineItem [productId=1, title=Apples, quantity=7], LineItem [productId=3, title=Bananas, quantity=4]) (ShoppingCartSpec.scala:91)
[JVM-2] - must handle updates from different nodes *** FAILED ***
[JVM-2] Set(LineItem [productId=1, title=Apples, quantity=7]) was not equal to Set(LineItem [productId=1, title=Apples, quantity=7], LineItem [productId=3, title=Bananas, quantity=4]) (ShoppingCartSpec.scala:91)
Interesting case. Might be the result of https://github.com/akka/akka/issues/22890 (fixed) as both setup and symptoms are very similar.
It might also be a result of LWWMap anomaly - see here: https://github.com/akka/akka/blob/master/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWMapSpec.scala#L66-L68
I have added a PR for alternative Shopping Cart design based on ORMultiMap.emptyWithValueDeltas that should be free from this sort of anomalies.