660058570d5337431d28e5a08814fbf96989afc0,tests/storages_tests/rdb_tests/test_storage.py,,test_record_heartbeat,#,308

Before Change



        with _create_scoped_session(storage.scoped_session) as session:
            StudyModel.find_or_raise_by_id(study._study_id, session)
            trial_ids = (
                session.query(TrialModel.trial_id)
                .filter(TrialModel.study_id == study._study_id)
                .filter(TrialModel.state.in_((TrialState.COMPLETE,)))
                .all()
            )
            for trial_id_tuple in trial_ids:
                heartbeat_model = TrialHeartbeatModel.where_trial_id(trial_id_tuple[0], session)
                assert heartbeat_model is not None
                trial_heartbeats.append(heartbeat_model.heartbeat)

After Change


        trial_heartbeats = []

        with _create_scoped_session(storage.scoped_session) as session:
            trial_ids = [trial._trial_id for trial in study.trials]
            for trial_id in trial_ids:
                heartbeat_model = TrialHeartbeatModel.where_trial_id(trial_id, session)
                assert heartbeat_model is not None
                trial_heartbeats.append(heartbeat_model.heartbeat)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: pfnet/optuna
Commit Name: 660058570d5337431d28e5a08814fbf96989afc0
Time: 2021-01-22
Author: gohome.x105.gn@gmail.com
File Name: tests/storages_tests/rdb_tests/test_storage.py
Class Name:
Method Name: test_record_heartbeat


Project Name: comic/grand-challenge.org
Commit Name: 3c53d87a9515c81df25b818e577d7dce66f18f90
Time: 2013-07-08
Author: w.s.kerkstra@gmail.com
File Name: django/comicsite/tests.py
Class Name: ViewsTest
Method Name: _signup_user


Project Name: comic/grand-challenge.org
Commit Name: 6499769919b50f645fd3d76623225eacf0cd141d
Time: 2013-07-08
Author: w.s.kerkstra@gmail.com
File Name: django/comicsite/tests.py
Class Name: ViewsTest
Method Name: _signup_user