Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

fix integration tests for bandwidth measurements #20

Open
david415 opened this issue Jul 6, 2016 · 5 comments
Open

fix integration tests for bandwidth measurements #20

david415 opened this issue Jul 6, 2016 · 5 comments

Comments

@david415
Copy link
Member

david415 commented Jul 6, 2016

Currently in the develop branch we have a couple of integration test classes set to be skipped because these tests contain race conditions. The race condition has to do with not sending enough cells over a circuit to make a proper bandwidth estimate because the circuit is closed too quickly after sending the entire test payload.

btw i am calling them integration tests since they require chutney instead of utilizing mock patterns.

@DonnchaC
Copy link
Member

DonnchaC commented Jul 6, 2016

The problem is not that it doesn't send enough cells, its because the test payload transmission does not take long enough. The Tor control port only emits bandwidth events approx. once per second. We need to make sure the payload transmission takes at least a couple of seconds in order to ensure we have enough measurements to perform the bandwidth calculations.

@david415
Copy link
Member Author

david415 commented Jul 7, 2016

some failed attempts in my dev branches to slow the test server protocol:
https://github.com/david415/bwscanner/tree/fix_tests.3
https://github.com/david415/bwscanner/tree/fix_tests.2
...

@david415
Copy link
Member Author

david415 commented Jul 7, 2016

It could be that the twisted web agent class disconnects from the server if a malformed response is received... that might be why my dev branches don't work; @DonnchaC pointed out that the bug on this line which would cause malformed responses from the server:
https://github.com/david415/bwscanner/blob/fix_tests.3/test/test_listener.py#L60

I haven't yet tried fixing it and seeing if the tests pass.

@DonnchaC
Copy link
Member

DonnchaC commented Jul 7, 2016

I don't thing that bug is causing an issue in this case. Size is always set to 1, so the call offset+1 and offset+size are equivalent. It should be fixed in case we are using different sized chunks in future.

@DonnchaC
Copy link
Member

DonnchaC commented Jul 7, 2016

StreamBandwidthListener() is currently not being used for generating measurements. It is just included in test_listener.py. As the tests for this code don't pass, I think that this code and tests should be removed for now. PR in #21

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

No branches or pull requests

3 participants