influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

Fixed gzip tests by comparing decompressed values #854

Open DrakezulsMinimalism opened 4 years ago

DrakezulsMinimalism commented 4 years ago

During #852 and #853 I noticed had failures in the test suite for gzip (even though I anticipated that nothing related had been changed by me).

Turns out that gzip uses metadata during compression, here the timestamp, that is then included in the binary compressed results. Therefore

  1. gzip could be supplied with a static timestamp (possibly also filename, but that did not make a difference for my test runs with one million iterations) to have the same binary output at all times
  2. the test should compare the decompressed result rather than the binary result

I chose option 2 because it avoids the tests to have an impact on the actual implementation of the client, which would have dirty and, in this case, unnecessary.

Contributor checklist