protected function retryWhileNotReady($reportId)
    {
        $attempts = 0;
        do {
            $report = $this->post('Report.Get', array(
                'reportID' => $reportId,
            ));
            $sleep = $this->getSleepSeconds(++$attempts, 50);
            if ($sleep !== false) {
                sleep($sleep);
            }
        } while (isset($report['error']) && $report['error'] == 'report_not_ready');

        if (isset($report['report'])) {
            $report = $report['report'];
        } else {
            throw new ReportError($report['error_description'], null);
        }

        return $report;
    }