celery / kombu

Messaging library for Python.
http://kombu.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
2.81k stars 920 forks source link

fix to refresh sts token at 80% of TTL for issue #2031 #2035

Open chenxg283 opened 1 week ago

chenxg283 commented 1 week ago

Fix for issue #2031

  1. merge the common code to refresh the sts token in one if-block, i.e. either when sts token not present or when the token is going to expire soon;
  2. replanced the datetime.utcnow() as it is deprecated;
  3. refresh the sts token at 80% of its TTL.
Nusnus commented 1 week ago

we will need extensive test coverage to very this changes

I am 100% with @auvipy here. I’ve converted the PR to draft until tests can be added.

Thank you and I hope you understand @chenxg283 🙏

chenxg283 commented 5 days ago

Sorry, i am new to this. Am I supposed to write the code for the test coverage?

Nusnus commented 2 days ago

Sorry, i am new to this.

It’s fine :)

Am I supposed to write the code for the test coverage?

Yes, you need to add automatic tests (that the CI will run automatically, but you can also run locally using tox). These tests need to validate that the changes the PR introduces are indeed working as expected. They also need to ensure that there are no bugs, to the best reasonable effort possible.

You can see the existing test suites to check how other tests are implemented.