def test_process_raw_results(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([{'one': 1.0}])
        res2 = msgpack.packb([{'two-1': 2.1}, {'two-2': 2.2}])
        self.run_results.process_raw_results(res1)
        self.run_results.process_raw_results(res2)

        # Still nothing flushed to disk yet (those two sets of messages
        # shouldn't be over the threshold of 1024 bytesnot over threshold)
        assert_equal(start_size - self._current_size(), 0)

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

        # Now we should have written out the buffer (in the writer thread).
        assert_greater(self._current_size() - start_size, 1024)
dataset/ETHPy150Open swiftstack/ssbench/ssbench/tests/test_run_results.py/TestRunResults.test_process_raw_results/swapped operands of `-`