Your HP S2031 has a DVI connection, too.
I would suggest trying that connection to see if that allows the use of the other Thunderbolt port. You would need the correct Thunderbolt to DVI adapter, of course.
Yes, it shouldn't make a difference, but the connection, being all digital, may then function (or not - no way to know unless you try it)
And, you test the ports by plugging in a Thunderbolt device of some kind.
And - if you have one, you already know that they sell at a premium price.
If you don't have a Thunderbolt device, other than an adapter for one external display, then you only need that one port anyway
. Test the other port with a borrowed device - or take to an Apple store, or maybe an authorized repair center if you have one local to you. Explain your situation, and you should be able to hook up some device just to test.
You COULD boot to your hardware test - although I don't know if the test will show anything for a port that doesn't see a device attached. The test may simply not report anything - but might be worth doing. Restart to your hardware test (Restart, holding the letter D on your keyboard. You should boot to the hardware test. Run both the standard and extended tests. You're supposed to disconnect any external devices to run the test, so might be pointless anyway. But, you can check if any error codes are reported)