@anze3db@fosstodon.org
@anze3db@fosstodon.org avatar

anze3db

@anze3db@fosstodon.org

Writing Python :python:, Django :django: and surfing waves 🏄‍♂️

Projects:
🧪 https://flakytest.dev tame your test suite flakiness
🧑‍💻 https://fedidevs.com find awesome devs across the fediverse
💻 https://github.com/anze3db/django-tui a TUI for all your Django commands

This profile is from a federated server and may be incomplete. Browse more on the original instance.

anze3db, to random
@anze3db@fosstodon.org avatar

One thing that I'm missing with HTMX and Django is proper error handling.

By default HTMX swallows any response that is not a 2xx, which might leave your users hanging on an endless loading state.

Does anyone have a good solution for this that can be reused between projects?

video/mp4

anze3db,
@anze3db@fosstodon.org avatar

As a stopgap solution I solved this by returning a 200 response with an error content, but I am curious how others deal with errors and HTMX.

video/mp4

anze3db, to random
@anze3db@fosstodon.org avatar

The fact that golang makes you think about errs on every function call is not a bad idea.

You'll have to deal with the error eventually and the closer you are to where the error came from the easier is it going to be.

anze3db, to random
@anze3db@fosstodon.org avatar

Signups for https://flakytest.dev have almost completely stopped and only 3 out of the 180 signups configured the pytest plugin and successfully submitted test results to process.

None of those 3 users ever returned after that so I continue to be the only active user 🥲

anze3db,
@anze3db@fosstodon.org avatar

I'm not giving up on it yet, I think there is still potential. I just have to figure how to communicate the idea/value of the product better and then figure out how to find the users that might be interested in trying it.

anze3db,
@anze3db@fosstodon.org avatar

@andreagrandi oh yes, please let me know why it wouldn't help your specific case. That's probably some of the most valuable feedback that I can get right now!

anze3db,
@anze3db@fosstodon.org avatar

@andreagrandi I see, you'd basically have to mute all of your tests that have the page load issue, which if I understand correctly is most of your old test suite?

Personally, I would still find it useful to know which tests are impacted by this and how often failures happens. If 60 out of 100 tests are flaky I'd also prefer to have the 60 skipped/muted, so that I could at least trust the remaining 40.

anze3db,
@anze3db@fosstodon.org avatar

@andreagrandi I've worked with multiple teams and reruning tests never solved the actual issue.

If one test can fail once, it can also fail 2, 3 or 5 times in a row. It’s just going to be less likely that it will fail, but you will still have a problem.

With more and more tests getting retried it's more and more likely that one of them will fail in one of the retries, making it less and less likely you'll have a successful build. You can't win with this approach 😞

anze3db,
@anze3db@fosstodon.org avatar

@andreagrandi I'd really need to see your fail numbers to properly understand this. If 90% of your tests are flaky I'd imagine your entire build would fail very often, no? Maybe 50% of the time? If that's the case the main issue is that devs can start ignoring failures which means that you have 0 tests, so running only 10% of the tests would be an improvement.

If you only see your full build fail 5% of the time then this is different of course.

anze3db,
@anze3db@fosstodon.org avatar

@alextomkins I intentionally tried to stay away from test suite health/performance because there are already a few bigger players in this space that I felt I couldn't compete with.

None of the big players offer actively managing (aka muting) tests so I was hoping that could give me a bit of an edge, but so far it hasn't worked out that way 😅

My grand plan was to move towards automating flake detection like in this post https://github.blog/2020-12-16-reducing-flaky-builds-by-18x/ but building all of this with no users feels risky.

anze3db,
@anze3db@fosstodon.org avatar

@alextomkins flakytest is currently free for everyone (the pricing page is a bit of a lie, because I never implemented billing) and the GitHub Marketplace page (not linked anywhere 🤦) does mention that it's free for non profits and open source.

I like the idea about public pages with stats though. I might give that a go!

Oh, and thank you for all the feedback, I really appreciate it! 💚

anze3db, to random
@anze3db@fosstodon.org avatar

Microsoft Office has a tri-state boolean with 5 values three of which are not supported, including the value 1.

True is -1.

anze3db, to random
@anze3db@fosstodon.org avatar

I was hoping they were fixing the sandbank that was making the waves closeout last winter, but they are laying the undersea fiber optic cables to add additional capacity between Europe and Africa! That's also really cool!

leonid, to python German
@leonid@norden.social avatar

djangoproject.com is down :omya_python:

#python #django

anze3db,
@anze3db@fosstodon.org avatar

@leonid It's a bit slow (5s per response), but seems to be working for me.

anze3db, to random
@anze3db@fosstodon.org avatar

Adding some error handling to the follow account feature at https://fedidevs.com.

Now that I've been writing Golang for a few weeks I am realizing that it's way to easy to forget about error handling in Python 😅

anze3db,
@anze3db@fosstodon.org avatar

@preslavrachev to be fair, at least in Python there usually is someone else that catches and handles the exception for you. In this case the only change is the error message seen by the user.

It is scary that you can happily write code without even knowing that something could go wrong. The docs for this particular function never mention any possible exceptions 😱

anze3db,
@anze3db@fosstodon.org avatar

@preslavrachev I still think it depends™️

If I'm writing a one off script I don't want to handle 4 different errors properly, I just want to call that API endpoint. Likewise if I’m writing an endpoint that only 10 people will actually hit every month. The odds of something going wrong are two low to warrant the extra work.

But when I have to run some code that will run every minute of every day that's where I want to know every single thing that could possibly go wrong in every line.

anze3db, to random
@anze3db@fosstodon.org avatar

🔴 Badass girls are sexy.

anze3db,
@anze3db@fosstodon.org avatar

@kaschu of course!

anze3db, to random
@anze3db@fosstodon.org avatar

Interesting, a message queue library written in Golang built on top of SQLite.

https://www.goqite.com/

anze3db, to random
@anze3db@fosstodon.org avatar

The only reason not to deploy to prod on Fridays is that you have a four day work week and you have Fridays off.

anze3db,
@anze3db@fosstodon.org avatar
adamchainz, to python
@adamchainz@fosstodon.org avatar

✍️ New post covering a small helper to return all subclasses of a given class.

https://adamj.eu/tech/2024/05/10/python-all-subclasses/

anze3db,
@anze3db@fosstodon.org avatar

@adamchainz yield from makes the implementation really clean! 👍

anze3db, to random
@anze3db@fosstodon.org avatar

I've just figured out that when you use the ci" or ci( vim motion you don't have to be in the middle of the thing that you want to change. It will work even if you are at the beginning of the line 🤯

video/mp4

anze3db, to random
@anze3db@fosstodon.org avatar

Great video by Anthony on tracking down which tests are polluting your global namespace and causing hard-to-debug test failures!

https://www.youtube.com/watch?v=BoZDpQnA-Xw

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • Durango
  • thenastyranch
  • ngwrru68w68
  • InstantRegret
  • DreamBathrooms
  • modclub
  • magazineikmin
  • Youngstown
  • everett
  • ethstaker
  • slotface
  • rosin
  • anitta
  • kavyap
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • provamag3
  • khanakhh
  • tacticalgear
  • cubers
  • Leos
  • normalnudes
  • megavids
  • tester
  • lostlight
  • All magazines