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

TestResultCoordinator: Explicitly fail for duplicate expected results (#4684) #4863

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

and-rewsmith
Copy link
Contributor

… (#4684)

We need to account for duplicate expected results in our tests. The test report operates with an assumption that expected results are unique and actual results can be duplicated. When duplicate expected results happen (due to product issues), the test report makes it seem like we are missing some actual results. But we need to make it explicit that there are duplicate expected results, which should not be happening in our tests.

Here is what I mean. Imagine the following scenario:

Message 0 sent
Message 1 sent
Message 1 sent
Message 2 sent

~ time passes ~

Message 0 received
Message 1 received
Message 1 received
Message 2 received

In the TRC here are the expected / actual datastructures:

Expected: 0->1->1->2
Actual: 0->1->1->->2

When the TRC is processing the report it does not account for duplicate actual results. So it is the same scenario as this:

Expected: 0->1->1->2
Actual: 0->1->2

In processing the counting report, we match results 0 and 1. We see that there are duplicate actual results for 1 so we eliminate them. Then end up in this state which is the problem. Now the counting report will view the situation as we have an unmatched expected result with sequence number 1. This is not the case.

Expected: 1->2
Actual: 2

The report looks indicates there is one unmatched result. But really all results are matched. It is just that there is a duplicate expected result. The test report will now reflect this by giving us the number of duplicate expected results that were seen.

…Azure#4684)

We need to account for duplicate expected results in our tests. The test report operates with an assumption that expected results are unique and actual results can be duplicated. When duplicate expected results happen (due to product issues), the test report makes it seem like we are missing some actual results. But we need to make it explicit that there are duplicate expected results, which should not be happening in our tests.

Here is what I mean. Imagine the following scenario:
```
Message 0 sent
Message 1 sent
Message 1 sent
Message 2 sent

~ time passes ~

Message 0 received
Message 1 received
Message 1 received
Message 2 received
``` 

In the TRC here are the expected / actual datastructures:
```
Expected: 0->1->1->2
Actual: 0->1->1->->2
```

When the TRC is processing the report it does not account for duplicate actual results. So it is the same scenario as this:
```
Expected: 0->1->1->2
Actual: 0->1->2

```

In processing the counting report, we match results 0 and 1. We see that there are duplicate actual results for 1 so we eliminate them. Then end up in this state which is the problem. Now the counting report will view the situation as we have an unmatched expected result with sequence number 1. This is not the case. 
```
Expected: 1->2
Actual: 2

```

The report looks indicates there is one unmatched result. But really all results are matched. It is just that there is a duplicate expected result. The test report will now reflect this by giving us the number of duplicate expected results that were seen.
@and-rewsmith and-rewsmith changed the title TestResultCoordinator: Explicitly fail for duplicate expected results TestResultCoordinator: Explicitly fail for duplicate expected results (#4684) Apr 16, 2021
@kodiakhq kodiakhq bot merged commit 3393473 into Azure:master Apr 16, 2021
ggjjj pushed a commit to ggjjj/iotedge that referenced this pull request Jul 22, 2021
…Azure#4684) (Azure#4863)

… (Azure#4684)

We need to account for duplicate expected results in our tests. The test report operates with an assumption that expected results are unique and actual results can be duplicated. When duplicate expected results happen (due to product issues), the test report makes it seem like we are missing some actual results. But we need to make it explicit that there are duplicate expected results, which should not be happening in our tests.

Here is what I mean. Imagine the following scenario:
```
Message 0 sent
Message 1 sent
Message 1 sent
Message 2 sent

~ time passes ~

Message 0 received
Message 1 received
Message 1 received
Message 2 received
``` 

In the TRC here are the expected / actual datastructures:
```
Expected: 0->1->1->2
Actual: 0->1->1->->2
```

When the TRC is processing the report it does not account for duplicate actual results. So it is the same scenario as this:
```
Expected: 0->1->1->2
Actual: 0->1->2

```

In processing the counting report, we match results 0 and 1. We see that there are duplicate actual results for 1 so we eliminate them. Then end up in this state which is the problem. Now the counting report will view the situation as we have an unmatched expected result with sequence number 1. This is not the case. 
```
Expected: 1->2
Actual: 2

```

The report looks indicates there is one unmatched result. But really all results are matched. It is just that there is a duplicate expected result. The test report will now reflect this by giving us the number of duplicate expected results that were seen.
damonbarry pushed a commit to damonbarry/iotedge that referenced this pull request Apr 15, 2022
…Azure#4684) (Azure#4863)

… (Azure#4684)

We need to account for duplicate expected results in our tests. The test report operates with an assumption that expected results are unique and actual results can be duplicated. When duplicate expected results happen (due to product issues), the test report makes it seem like we are missing some actual results. But we need to make it explicit that there are duplicate expected results, which should not be happening in our tests.

Here is what I mean. Imagine the following scenario:
```
Message 0 sent
Message 1 sent
Message 1 sent
Message 2 sent

~ time passes ~

Message 0 received
Message 1 received
Message 1 received
Message 2 received
``` 

In the TRC here are the expected / actual datastructures:
```
Expected: 0->1->1->2
Actual: 0->1->1->->2
```

When the TRC is processing the report it does not account for duplicate actual results. So it is the same scenario as this:
```
Expected: 0->1->1->2
Actual: 0->1->2

```

In processing the counting report, we match results 0 and 1. We see that there are duplicate actual results for 1 so we eliminate them. Then end up in this state which is the problem. Now the counting report will view the situation as we have an unmatched expected result with sequence number 1. This is not the case. 
```
Expected: 1->2
Actual: 2

```

The report looks indicates there is one unmatched result. But really all results are matched. It is just that there is a duplicate expected result. The test report will now reflect this by giving us the number of duplicate expected results that were seen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants