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
![image](https://user-images.githubusercontent.com/1634096/57194525-7fa93680-6f7a-11e9-9830-1864336759d7.png)
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:
![image](https://user-images.githubusercontent.com/1634096/57194885-c305a400-6f7e-11e9-80e4-79a83fcfdeed.png)
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.
![image](https://user-images.githubusercontent.com/1634096/57194848-2f33d800-6f7e-11e9-98e8-35f5c4ec2187.png)
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.