def METHOD_NAME(self, serial, timeout=20):
    global badxfrServer
    badxfrServer.moveToSerial(serial)
    attempts = 0
    while attempts < timeout:
        currentSerial = badxfrServer.getCurrentSerial()
        if currentSerial > serial:
            raise AssertionError("Expected serial %d, got %d" % (serial, currentSerial))
        if currentSerial == serial:
            badxfrServer.moveToSerial(serial+1)
            return
        attempts = attempts + 1
        time.sleep(1)
    raise AssertionError("Waited %d seconds for the serial to be updated to %d but the serial is still %d" % (timeout, serial, currentSerial))