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

[Carry #1990]Fix notification unit test #2133

Merged
merged 1 commit into from
Jan 10, 2017

Conversation

dmcgowan
Copy link
Collaborator

If running test behide a proxy, we may get the error code
403 Forbidden which will fail line 135 for the last testcase.

Detail:

metrics not as expected: notifications.EndpointMetrics{Pending:0,
Events:0, Successes:4, Failures:0, Errors:0,
Statuses:map[string]int{"307 Temporary Redirect":0, "400 Bad Request":0,
"403 Forbidden":0, "200 OK":4}} !=
notifications.EndpointMetrics{Pending:0, Events:0, Successes:4,
Failures:0, Errors:0, Statuses:map[string]int{"400 Bad Request":0, "200
OK":4, "307 Temporary Redirect":0}}

Immediate close will fix that

Signed-off-by: Hu Keping [email protected]
Signed-off-by: Derek McGowan [email protected]

@dmcgowan dmcgowan mentioned this pull request Jan 10, 2017
@stevvooe
Copy link
Collaborator

Shouldn't this be a new case? I think was testing a failed DNS resolution here.

@dmcgowan
Copy link
Collaborator Author

dmcgowan commented Jan 10, 2017

The comment was unclear. It appeared to only really be testing a pre-http network failure. Assuming DNS (or even route failure) should not really be in scope for the test as it is making too many assumption about the network, which cased the original issue in the first place. If a unit test can easily fail based on a network configuration the test is too fragile.

If running test behide a proxy, we may get the error code
403 Forbidden which will fail line 135 for the last testcase.

Detail:
```
metrics not as expected: notifications.EndpointMetrics{Pending:0,
Events:0, Successes:4, Failures:0, Errors:0,
Statuses:map[string]int{"307 Temporary Redirect":0, "400 Bad Request":0,
"403 Forbidden":0, "200 OK":4}} !=
notifications.EndpointMetrics{Pending:0, Events:0, Successes:4,
Failures:0, Errors:0, Statuses:map[string]int{"400 Bad Request":0, "200
OK":4, "307 Temporary Redirect":0}}
```

Immediate close will fix that

Signed-off-by: Hu Keping <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
@codecov-io
Copy link

Current coverage is 51.10% (diff: 100%)

Merging #2133 into master will decrease coverage by 10.00%

@@             master      #2133   diff @@
==========================================
  Files           125        125           
  Lines         11434      11434           
  Methods           0          0           
  Messages          0          0           
  Branches          0          0           
==========================================
- Hits           6987       5843   -1144   
- Misses         3559       4845   +1286   
+ Partials        888        746    -142   

Powered by Codecov. Last update 1140605...efc3209

@stevvooe
Copy link
Collaborator

@dmcgowan So, I wrote that comment. This test was there because the error for a DNS miss was different than a connection error. I don't remember any more details than that.

LGTM

@stevvooe stevvooe merged commit ff68ca3 into distribution:master Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants