51
Root
5y

I extracted a tangled action to its own api, and wrote a test for it.

The test failed.

I added debugging, more debugging, all the debugging. It still fails. But I can at least see why it fails!

It turns out the api finds and updates the wrong user. It finds and updates the wrong user EVEN WHEN THERE ARE NO OTHER USERS.

WHAT THE SALAMI.

Also, the user lookup it uses is extremely roundabout and takes several seconds with ~2 million users. Normally I'd fix the lookup, but it has been in production for several years, and I'm terrified it will break something if I fix it.

Blargherhagrid.

Comments
  • 2
    That sounds horrible!
  • 6
    @rutee07 "...But you're tenured so I can't fire you! 😡"
  • 3
    @RiderExMachina to me it sounds similar.... Typical of code left over by monkeys that I have to maintain....
  • 4
    Sigh. Bad test is bad test:

    Two of my fixtures (factories) were creating users; the api found the second one.

    The user lookup is still very slow, though. I'll write (working!) tests for that at some point and replace it.
  • 3
    What. The. Actual. Fuck?.....
  • 5
    What the salami 😂😂
  • 1
    @Root oh no! Building it across a few years can make things break because of stale packages, check your packages (if you're running on node.js ofc)

    P.S: I developed my own Login system (I just found this rant sorry if I'm not even relating to the right stuff) so maybe I can help you
Add Comment