If I am running bitcoind then bitcoin-cli walletpassphrase $pass 5 will unlock my wallet for 5 seconds.
But if I am running bitcoin-qt then the same command will unlock my wallet indefinitely, and show an error in the debug.log:
GUI: QObject::startTimer: Timers can only be used with threads started with QThread
I built from the master branch, commit b1cf005.