core: Partially fix TestContext2Apply_resourceDependsOnModule
InstanceInfo.HumanId() is no longer functional, since our shim from the new to the old provider API doesn't populate it. Therefore we must use other means to distingush the two instances here, and we'll use the "ami" attribute value to do so.
This commit is contained in:
parent
f0b7d01072
commit
3ad2930c21
|
@ -238,7 +238,8 @@ func TestContext2Apply_resourceDependsOnModule(t *testing.T) {
|
|||
info *InstanceInfo,
|
||||
is *InstanceState,
|
||||
id *InstanceDiff) (*InstanceState, error) {
|
||||
if info.HumanId() == "module.child.aws_instance.child" {
|
||||
|
||||
if id.Attributes["ami"].New == "child" {
|
||||
|
||||
// make the child slower than the parent
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
resource "aws_instance" "child" {}
|
||||
resource "aws_instance" "child" {
|
||||
ami = "child"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
module "child" {
|
||||
source = "./child"
|
||||
source = "./child"
|
||||
}
|
||||
|
||||
resource "aws_instance" "a" {
|
||||
depends_on = ["module.child"]
|
||||
ami = "parent"
|
||||
|
||||
depends_on = ["module.child"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue