- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Comment frist = new Comment (frist);
Comment frist = new Comment (frist);
Admin
Doesn't the submitter know that if instantiating a class once is good, instantiating it twice is more gooder?
Admin
Where is the WTF? This is just a simple bug which probably is a result of a merge where two implementations got appended.
Admin
Always a warning sign when the developers say, this is always how its been.
Admin
There's a possible WTF ^^^ right there, where you merge changes and don't look at the result. Definitely WTF-worthy.
Admin
So, you're saying it's a coincidence that 400 tests passed? That's highly unlikely or they wrote really shitty tests. Come to think of it, they probably wrote really shitty tests
Admin
I bet they got intermittent failures on the unit tests in their CI builds, and no one knew why. Not that I'm speaking from experience or anything.
(Yes, I'm assuming they had continuous integration. I really, really hope they did anyway.)
Admin
No, the server that was started was listening on a port in its own thread and would not have been garbage-collected. So the tests were fine. There was just a bug were an instance variable pointed to the wrong instance of a class.
Admin
If there's no live reference to the instance then there's also nothing receiving incoming connections, so none of their tests can be connecting to it...
Or they're doing something really dodgy in their finalize() method.
Admin
correct, but there is something WTF-y about the fact that none of their tests caught that
Admin
There must be something edited out of the story, it doesn't read complete.
Admin
' It was much harder to understand how and why that line got there in the first place, or why no one had ever noticed it before.'
The first is a head scratch (looks kind of like a copypasta oops), the second is easy - because their tests never failed nobody ever looked.
Admin
Exaclty, a Thread is a GC root, so there's no WTF, just a small WTH.
Admin
Maybe they started without the second instance and it worked for the first test case. Then they added a second test case and the creation threw an exception like "port already in use", because the first instance was not shut down by the garbage collector before the second was created. So they deleted the reference to the first, and, by chance, the garbage collector kicked in just at the right time to make both test cases work. The WTF here seems to be letting the garbage collector choosing the time when the server is shut down instead of doing it explicitely. (And providing a static varibale in a parent class for use in multiple test cases, which creates depedencies between the test cases. Although it creates no problem in this special case.)
Admin
I honestly expected this story to end by revealing that the "test instance" of the notification server was, in fact, the live production one and by attempting to restart the service, Alex had killed the demo product and cost the company hundreds of thousands of dollars in lost potential revenue.
Admin
Admin
The real WTF is 'unit tests' that fire up a real instance and create other side effects.
Admin
Reminds me of a major-league old-school cloud provider. They carefully wrote a backup program to backup all the user files every night. And a job scheduler to run the backup program every night at 2AM. And a report generator that sent a backup log to the line-printer to be delivered to the manager. All fine so far. The manager got a thick printout every morning of all files changed. Manager happy, everybody happy.
Then about two months later a user wiped out their main file and called in to get the file restored.
So the customer service folks, who were rather savvy, wrote the control cards to mount the backup tape and do an extract USER73/*.
No soap. The write backup job mounted the tape as 6250BPI but actually wrote it at 1200BPI, which gives you a tape of garbage. Nobody had actually bothered to TEST the backup tapes, so all the backups were useless.