test: use a fixed length name for temp directories#2544
Conversation
another-rex
left a comment
There was a problem hiding this comment.
I think technically we're meant to check whether that random folder already exists and generate a new random name if it does to avoid conflicts.
But what are the chances?
|
yeah that was my thinking - it should be easy to put in a loop for that if it ever happens, but it should already be pretty small and arguably by the same logic it's technically possible to generate directories with the same name that already exist on every loop, at which point 🤷 so line has to be somewhere right |
4f87d65 to
3dbe266
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2544 +/- ##
==========================================
- Coverage 67.92% 67.90% -0.02%
==========================================
Files 172 172
Lines 13395 13401 +6
==========================================
+ Hits 9098 9100 +2
- Misses 3581 3583 +2
- Partials 716 718 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
ok so turns out this wasn't needed because we're outputting absolute paths which will differ in length anyway due to different OS/path setups 🙃 |
Most of the time
os.MkdirTempcreates directories with the same number of characters, but its not required to and will occasionally has one less character than what is common, which can result in the table output being slightly different.This is compounded by us replacing the temp directory with a fixed string
<tempdir>marker, as it ends up looking like the table marks are just randomly changing for no reason 🤦