)]}'
{"contrib/tempest/tempest/scenario/test_host_reservation.py":[{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"2efa7cdc19c5a6d679b1ff729a3594efe281f1f0","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                lambda h: h[\u0027hypervisor_hostname\u0027] \u003d\u003d host[\u0027host\u0027], hosts)))"},{"line_number":165,"context_line":"        except StopIteration:"},{"line_number":166,"context_line":"            self.reservation_client.create_host({\u0027name\u0027: host[\u0027host\u0027]})"},{"line_number":167,"context_line":"        self._add_host_in_freepool(host)"},{"line_number":168,"context_line":"        return host"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_host_in_freepool(self, host):"},{"line_number":171,"context_line":"        freepool \u003d self.fetch_aggregate_by_name(\u0027freepool\u0027)"},{"line_number":172,"context_line":"        if not freepool[\u0027hosts\u0027]:"},{"line_number":173,"context_line":"            self.aggr_client.add_host(freepool[\u0027id\u0027],"},{"line_number":174,"context_line":"                                      host\u003dhost[\u0027host\u0027])"},{"line_number":175,"context_line":"        return freepool"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    @decorators.attr(type\u003d\u0027smoke\u0027)"},{"line_number":178,"context_line":"    def test_host_reservation(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_e400cc03","line":175,"range":{"start_line":167,"start_character":0,"end_line":175,"end_character":23},"updated":"2017-08-29 08:43:08.000000000","message":"Is this part needed? The create_host() at L166 already added the host into the freepool.","commit_id":"2426672eb754607acfadf18acf937e7dbb05ee27"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e613c6375ac920067b3f577e37465e6fce768e4c","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                lambda h: h[\u0027hypervisor_hostname\u0027] \u003d\u003d host[\u0027host\u0027], hosts)))"},{"line_number":165,"context_line":"        except StopIteration:"},{"line_number":166,"context_line":"            self.reservation_client.create_host({\u0027name\u0027: host[\u0027host\u0027]})"},{"line_number":167,"context_line":"        self._add_host_in_freepool(host)"},{"line_number":168,"context_line":"        return host"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_host_in_freepool(self, host):"},{"line_number":171,"context_line":"        freepool \u003d self.fetch_aggregate_by_name(\u0027freepool\u0027)"},{"line_number":172,"context_line":"        if not freepool[\u0027hosts\u0027]:"},{"line_number":173,"context_line":"            self.aggr_client.add_host(freepool[\u0027id\u0027],"},{"line_number":174,"context_line":"                                      host\u003dhost[\u0027host\u0027])"},{"line_number":175,"context_line":"        return freepool"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    @decorators.attr(type\u003d\u0027smoke\u0027)"},{"line_number":178,"context_line":"    def test_host_reservation(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_628dd330","line":175,"range":{"start_line":167,"start_character":0,"end_line":175,"end_character":23},"in_reply_to":"7f287b81_8a3d91de","updated":"2017-08-30 02:59:38.000000000","message":"Oh, I missed a problem. Please check my comment for the patch Ied3c766a1d7d839eb4301b494e4b35c75151f242 for the first.","commit_id":"2426672eb754607acfadf18acf937e7dbb05ee27"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"6e50d68ff7e3fc998aa12b513bd58a78911ef360","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                lambda h: h[\u0027hypervisor_hostname\u0027] \u003d\u003d host[\u0027host\u0027], hosts)))"},{"line_number":165,"context_line":"        except StopIteration:"},{"line_number":166,"context_line":"            self.reservation_client.create_host({\u0027name\u0027: host[\u0027host\u0027]})"},{"line_number":167,"context_line":"        self._add_host_in_freepool(host)"},{"line_number":168,"context_line":"        return host"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_host_in_freepool(self, host):"},{"line_number":171,"context_line":"        freepool \u003d self.fetch_aggregate_by_name(\u0027freepool\u0027)"},{"line_number":172,"context_line":"        if not freepool[\u0027hosts\u0027]:"},{"line_number":173,"context_line":"            self.aggr_client.add_host(freepool[\u0027id\u0027],"},{"line_number":174,"context_line":"                                      host\u003dhost[\u0027host\u0027])"},{"line_number":175,"context_line":"        return freepool"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    @decorators.attr(type\u003d\u0027smoke\u0027)"},{"line_number":178,"context_line":"    def test_host_reservation(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_8a3d91de","line":175,"range":{"start_line":167,"start_character":0,"end_line":175,"end_character":23},"in_reply_to":"7f287b81_e400cc03","updated":"2017-08-29 10:46:09.000000000","message":"It removed the host from freepool by L257, to create condition of lease expiration.\nI fixed it to delete the host.\nIs my understanding correct?","commit_id":"2426672eb754607acfadf18acf937e7dbb05ee27"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e3cd3fb0521e6a3de9c116747dbed313dd329d85","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        host \u003d self._add_host_once()"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # create new lease and start reservation immediately"},{"line_number":275,"context_line":"        body \u003d self.get_lease_body(\u0027scenario-3-update\u0027, host[\u0027host\u0027])"},{"line_number":276,"context_line":"        lease \u003d self.reservation_client.create_lease(body)[\u0027lease\u0027]"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # check host added to the reservation"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_3d19c687","line":275,"range":{"start_line":275,"start_character":0,"end_line":275,"end_character":69},"updated":"2017-09-04 09:04:39.000000000","message":"The end_time of this lease will be updated with +1 mins at L298. To ensure the lease end is triggered by update lease API, it\u0027s better to set 5 mins later or more.","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"38cdf0882132a7b1b3130e36841ecacb56847240","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        host \u003d self._add_host_once()"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # create new lease and start reservation immediately"},{"line_number":275,"context_line":"        body \u003d self.get_lease_body(\u0027scenario-3-update\u0027, host[\u0027host\u0027])"},{"line_number":276,"context_line":"        lease \u003d self.reservation_client.create_lease(body)[\u0027lease\u0027]"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # check host added to the reservation"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_bfd1d125","line":275,"range":{"start_line":275,"start_character":0,"end_line":275,"end_character":69},"in_reply_to":"5f2577a7_8c284de2","updated":"2017-09-14 23:28:40.000000000","message":"Yes, What I commented is the API call at L302 ensures to end the lease.  As you commented, the scale of end_time is a minute scale. So if the lease body specifies end_time over 5 mins, it can ensure that the update lease API at L302 changes end_time 5 mins later to 1 mins later or now and the server is deleted because of the end_time change.\n\nSo the end_time at create_lease should be more than 5 mins.","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"cefb61a4a298bb0bc96d59ee0ec4eedaee91ff66","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        host \u003d self._add_host_once()"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # create new lease and start reservation immediately"},{"line_number":275,"context_line":"        body \u003d self.get_lease_body(\u0027scenario-3-update\u0027, host[\u0027host\u0027])"},{"line_number":276,"context_line":"        lease \u003d self.reservation_client.create_lease(body)[\u0027lease\u0027]"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # check host added to the reservation"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_3712a563","line":275,"range":{"start_line":275,"start_character":0,"end_line":275,"end_character":69},"in_reply_to":"5f2577a7_bfd1d125","updated":"2017-09-15 06:46:34.000000000","message":"Done","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"930b710952232b64c48f94bbabc77dc79412de25","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        host \u003d self._add_host_once()"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # create new lease and start reservation immediately"},{"line_number":275,"context_line":"        body \u003d self.get_lease_body(\u0027scenario-3-update\u0027, host[\u0027host\u0027])"},{"line_number":276,"context_line":"        lease \u003d self.reservation_client.create_lease(body)[\u0027lease\u0027]"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        # check host added to the reservation"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_8c284de2","line":275,"range":{"start_line":275,"start_character":0,"end_line":275,"end_character":69},"in_reply_to":"7f287b81_3d19c687","updated":"2017-09-14 02:49:11.000000000","message":"Does this mean that the lease ends at the time update API was executed in L 302?\nAs blazar does not record seconds, if execution time (\u003d end_time) of update API is within 1 minute from lease start, start_time and end_time are considered to be the same time and API fails.\nTherefore, + 1 minute is specified in L.298 so that the lease will not end at the timing of update API.\nIs my understanding correct?","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e3cd3fb0521e6a3de9c116747dbed313dd329d85","unresolved":false,"context_lines":[{"line_number":301,"context_line":"            }"},{"line_number":302,"context_line":"        lease \u003d self.reservation_client.update_lease(lease[\u0027id\u0027],"},{"line_number":303,"context_line":"                                                     body)[\u0027lease\u0027]"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        # Wait until the lease expires"},{"line_number":306,"context_line":"        time.sleep(75)"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_7d062e23","line":304,"updated":"2017-09-04 09:04:39.000000000","message":"As I commented at https://review.openstack.org/#/c/482532/10/contrib/tempest/tempest/scenario/test_host_reservation.py, the test needs to create an instance here.","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"930b710952232b64c48f94bbabc77dc79412de25","unresolved":false,"context_lines":[{"line_number":301,"context_line":"            }"},{"line_number":302,"context_line":"        lease \u003d self.reservation_client.update_lease(lease[\u0027id\u0027],"},{"line_number":303,"context_line":"                                                     body)[\u0027lease\u0027]"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        # Wait until the lease expires"},{"line_number":306,"context_line":"        time.sleep(75)"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_b49f144f","line":304,"in_reply_to":"7f287b81_7d062e23","updated":"2017-09-14 02:49:11.000000000","message":"Done","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e3cd3fb0521e6a3de9c116747dbed313dd329d85","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        # Wait until the lease expires"},{"line_number":306,"context_line":"        time.sleep(75)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        # create an instance with reservation id. which is expected to fail,"},{"line_number":309,"context_line":"        # because the lease has expiration."},{"line_number":310,"context_line":"        create_kwargs \u003d {"},{"line_number":311,"context_line":"            \u0027scheduler_hints\u0027: {"},{"line_number":312,"context_line":"                \"reservation\": reservation_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_e081514c","line":309,"range":{"start_line":308,"start_character":0,"end_line":309,"end_character":43},"updated":"2017-09-04 09:04:39.000000000","message":"I think the assertion should check the resources related to scenario-3-update are removed well. For instance, the instance created above doesn\u0027t exist here instead of launching the new instance.","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"930b710952232b64c48f94bbabc77dc79412de25","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        # Wait until the lease expires"},{"line_number":306,"context_line":"        time.sleep(75)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        # create an instance with reservation id. which is expected to fail,"},{"line_number":309,"context_line":"        # because the lease has expiration."},{"line_number":310,"context_line":"        create_kwargs \u003d {"},{"line_number":311,"context_line":"            \u0027scheduler_hints\u0027: {"},{"line_number":312,"context_line":"                \"reservation\": reservation_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f2577a7_94c5383f","line":309,"range":{"start_line":308,"start_character":0,"end_line":309,"end_character":43},"in_reply_to":"7f287b81_e081514c","updated":"2017-09-14 02:49:11.000000000","message":"Done","commit_id":"a06305d1072c04af7042c93a510bcc6c7b2e5987"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"a6c4dc0b29df8a1b88e28281536259dc6f1f68d1","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        waiters.wait_for_server_status(self.os_admin.servers_client,"},{"line_number":318,"context_line":"                                       server[\u0027id\u0027], \u0027ACTIVE\u0027)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        # wait until enough time for blazar to run"},{"line_number":321,"context_line":"        time.sleep(75)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        # update the lease end_time"},{"line_number":324,"context_line":"        end_time \u003d datetime.datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_ab74719a","line":321,"range":{"start_line":320,"start_character":0,"end_line":321,"end_character":22},"updated":"2017-10-19 04:46:41.000000000","message":"I noticed the sleep command is needed?  The server creation by L314-318 ensures the lease already starts.","commit_id":"7f63932280e2905aa341350988ec4c99d2c48fc3"},{"author":{"_account_id":11704,"name":"Maho Koshiya","email":"koshiya.maho@po.ntt-tx.co.jp","username":"koshi-m"},"change_message_id":"455ce67480ceadf6999a68c5ed7507a6100e6310","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        waiters.wait_for_server_status(self.os_admin.servers_client,"},{"line_number":318,"context_line":"                                       server[\u0027id\u0027], \u0027ACTIVE\u0027)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        # wait until enough time for blazar to run"},{"line_number":321,"context_line":"        time.sleep(75)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        # update the lease end_time"},{"line_number":324,"context_line":"        end_time \u003d datetime.datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_c9574758","line":321,"range":{"start_line":320,"start_character":0,"end_line":321,"end_character":22},"in_reply_to":"3f4b6375_ab74719a","updated":"2017-10-24 09:39:11.000000000","message":"\"wait enough time for the update API to succeed\" may be more correct than \"wait until enough time for blazar to run\".\n\nAt L326, the current time is set to end_date.\nI wait for 1minutes +15seconds so that the time set here does not become the same as start_date.\nThis +15seconds is based on the comments below.\n\nhttps://review.openstack.org/#/c/482532/8/contrib/tempest/tempest/scenario/test_host_reservation.py@244","commit_id":"7f63932280e2905aa341350988ec4c99d2c48fc3"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"be5fa6f59dbe7d1d54f5cfaf6969b1a3496d177c","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        waiters.wait_for_server_status(self.os_admin.servers_client,"},{"line_number":318,"context_line":"                                       server[\u0027id\u0027], \u0027ACTIVE\u0027)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        # wait until enough time for blazar to run"},{"line_number":321,"context_line":"        time.sleep(75)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        # update the lease end_time"},{"line_number":324,"context_line":"        end_time \u003d datetime.datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_f504fb4b","line":321,"range":{"start_line":320,"start_character":0,"end_line":321,"end_character":22},"in_reply_to":"3f4b6375_c9574758","updated":"2017-10-25 01:39:26.000000000","message":"got it.  I edited the comment.","commit_id":"7f63932280e2905aa341350988ec4c99d2c48fc3"}]}
