def test_finalize(self):
        self.run_results.start_run(self.scenario)
        start_size = self._current_size()
        assert_greater(start_size, 0)  # sanity check

        self.run_results.write_threshold = 1024

        res1 = msgpack.packb([{'three': '3' * 1025}])
        self.run_results.process_raw_results(res1)
        time.sleep(0.01)  # give the writer thread time to write()

        # Now we should have written out the buffer (in the writer thread).
        new_size = self._current_size()
        assert_greater(start_size - new_size, 1024)

        # Send down a couple small ones, then finalize.  They should have
        # been written by the time finalize returns.
        res2 = msgpack.packb([{'two-1': 2.1}, {'two-2': 2.2}])
        res3 = msgpack.packb([{'three': '3'}])
        self.run_results.process_raw_results(res2)
        self.run_results.process_raw_results(res3)

        self.run_results.finalize()
        assert_equal(len(res2) + len(res3),
                     self._current_size() - new_size)
dataset/ETHPy150Open swiftstack/ssbench/ssbench/tests/test_run_results.py/TestRunResults.test_finalize/swapped operands of `-`