For I have known him, to the end that he may command his children and his household after him, that they may keep the way of Jehovah, to do righteousness and justice; to the end that Jehovah may bring upon Abraham that which he hath spoken of him. Genesis 18:19
Genesis 17:9
God also said to Abraham, "As for you, you must keep My covenant, you and your descendants for the generations to come.
Did they? No, they did not. They failed to keep the covenant. This is why we are told in Romans 9 that God has the right to work through them regardless. Because this was God keeping his promise to Abraham, in whatever way he needed to.
"Some time later God tested Abraham."Genesis 22
15 The angel of the Lord called to Abraham from heaven a second time 16 and said, “I swear by myself, declares the Lord, that because you have done this and have not withheld your son, your only son, 17 I will surely bless you and make your descendants as numerous as the stars in the sky and as the sand on the seashore. Your descendants will take possession of the cities of their enemies, 18 and through your offspring all nations on earth will be blessed,[c] because you have obeyed me.”
God says he kept his promise because Abraham passed the test of faith. If Abraham had not passed, would God have chosen someone else? God isn't locked into one course of action. He can change his mind as he wishes.