Bug description
Base on the DemoApp, I extended the graph like this
Graph declaration https://github.com/ampm/MappaMundi/blob/ampm/reproduce_finpath_bug/UITests/DemoMappaMundi.swift
The shortest way from screen itemDetail
to foo_5
should be:
itemDetail
->item_action_1
->foo_5
.
But, it doesn't work all the time, sometimes, it found out a longer path.
I added some code to the MMNavigator.swift
for debugging and invoked the navigation testing for 10 times.
override func invokeTest() {
for time in 0...10 {
print("this test is invoking: \(time) times")
super.invokeTest()
}
}
func testReproduceFindpathError() {
navigator.performAction(Actions.addItem)
navigator.goto(Screens.itemDetail)
navigator.goto(Screens.foo5)
}
The log shows:
Troubleshooting
At first, I doubted if it's a bug of Apple's GameplayKit ? I created a Playground to verify it.
In that Playground, I copied the graph in UITests and run it for 100 times.
But, the results can't prove my guess, it always returns the correct path.
How to reproduce this bug?
pls feel free to check out this repo
https://github.com/ampm/MappaMundi
branch name: reproduce_finpath_bug
then you can run the case func testReproduceFindpathError()
in DemoUITests.swift
.
@jhugman Can you give me any clue then I'll try to fix it?
Thanks a lot.