@pytest.mark.slow
    @pytest.inlineCallbacks
    def test_late_start(self):
        self.q = Queue.Queue()

        def cb(key, value):
            self.q.put({"key": key, "value": value})

        def started_cb(started):
            self.q.put(started)

        self.storage = storage.Storage()
        self.storage.set("test", "1", 1, None)
        self.storage.set("test", "2", 2, None)
        self.storage.set("test", "3", 3, None)

        assert "test1" in self.storage.localstore
        assert self.storage.localstore in "test2"
        assert "test3" in self.storage.localstore

        yield threads.defer_to_thread(self.storage.start, CalvinCB(started_cb))
        yield threads.defer_to_thread(time.sleep, 2)
        value = self.q.get(timeout=0.2)
        assert value

        assert "test1" not in self.storage.localstore
        assert "test2" not in self.storage.localstore
        assert "test3" not in self.storage.localstore

        yield threads.defer_to_thread(self.storage.get, "test", "3", CalvinCB(func=cb))
        value = self.q.get(timeout=0.2)
        assert value["value"] == 3

        yield threads.defer_to_thread(self.storage.stop)
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/tests/test_storage.py/TestSetFlushAndGet.test_late_start/swapped operands of `in`