Clarify lifespan vs on_startup/on_shutdown priority#2193
Clarify lifespan vs on_startup/on_shutdown priority#2193Kludex merged 12 commits intoKludex:masterfrom
Conversation
As per discussion (Kludex#2192), I am trying to make it more clear that if both lifespan AND on_startup/on_shutdown are used, regardless of the subtle hint that both should NOT be used, then only lifespan would be used and on_startup/on_shutdown would silently be ignored.
|
I don't think this is what we meant on the discussion (at least not what I mean). 🤔 I mean to raise a warning if |
|
Something like this? |
|
Yes. Are you able to create tests for it? |
|
Something like this? Note, locally some existing tests would still fail with: But this has nothing to do with my patch! |
|
Just noticed that this is the same reason why the online tests fail too, but I have no idea how to fix those... |
It does. You added the conditional in a block of other |
|
I am not sure I understand why it still fails. :( I see your edit of moving my if inside the previous if (makes sense) but still it behaves very weird... I'm not sure I can help anymore here... :( |
|
I now completely understand why so few projects have 100% test coverage. The amount of time I spend trying to make this trivial fix was close to 10 times more time in test authoring, rather than the actual code change itself (at least!!!). I am not sure if you really persist and become more proficient how much more efficient this process ever becomes... So as much as I would like to also have 100% coverage in my projects I do not know if I would ever find the time to actually do it. This is a task that I would not mind if some "testGPT" would ever take over! :) |
It is worth it, and it actually saves a lot of time. :) You should have asked for feedback if you were feeling frustrated. I believe the interpretation of the coverage report on your behalf was not accurate. |
I hope you mean the first time only, when I said "I'm not sure I can help anymore here... 😵💫 ", because after that I could not accept defeat and took a more serious look and finally changed the tests enough to pass the whole test suite. Give me some credit here! 😄 |
…own` (#2193) Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
As per discussion (#2192), I am trying to make it more clear that if both lifespan AND on_startup/on_shutdown are used, regardless of the subtle hint that both should NOT be used, then only lifespan would be used and on_startup/on_shutdown would silently be ignored.