Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic speed test depends on non-deterministic snapping behavior #4110

Closed
daniel-j-h opened this issue May 31, 2017 · 2 comments · Fixed by #4199
Closed

Traffic speed test depends on non-deterministic snapping behavior #4110

daniel-j-h opened this issue May 31, 2017 · 2 comments · Fixed by #4199
Assignees

Comments

@daniel-j-h
Copy link
Member

The following test depends on random behavior and how snapping works out:

Scenario: Weighting based on speed file weights, ETA based on file durations
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_precision = 2
"""
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
1,2,1,0.27777777
2,1,1,0.27777777
2,3,27,7.5
3,2,27
1,4,1
4,1,1
"""
And the query options
| annotations | datasources |
When I route I should get
| from | to | route | speed | weights | a:datasources |
| a | b | ab,ab | 1 km/h | 20020.73,0 | 1:0 |
| a | c | ab,bc,bc | 2 km/h | 20020.73,741.51,0 | 1:1:0 |
| b | c | bc,bc | 27 km/h | 741.51,0 | 1:0 |
| a | d | ab,eb,de,de | 2 km/h | 20020.73,378.17,400.41,0 | 1:0:0 |
| d | c | dc,dc | 36 km/h | 956.8,0 | 0 |
| g | b | ab,ab | 1 km/h | 10010.37,0 | 1:0 |
| a | g | ab,ab | 1 km/h | 10010.36,0 | 1 |
| g | a | ab,ab | 1 km/h | 10010.36,0 | 1:1 |

There is no way to g (see the network a bit above) and @MoKob pointed out snapping at b could be eb or ab. The test failure is currently on the mld/alternatives branch but it's not the cause for it (it's not hitting the alternatives code path at all).

Here's the test diff:

https://travis-ci.org/Project-OSRM/osrm-backend/jobs/237850494#L2198

cc @danpat for non-deterministic snapping behavior

@TheMarex
Copy link
Member

The whole test case should be rewritten using a node map and a more obvious graph structure.

@daniel-j-h daniel-j-h mentioned this issue Jun 20, 2017
9 tasks
@oxidase
Copy link
Contributor

oxidase commented Jun 26, 2017

The test case fail is not related to snapping and shows a data race in the assignments

fwd_weights_range[segment_offset] = new_weight;
and
rev_weights_range[segment_offset] = new_weight;
during parallel segment weights update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants