Skip to content

Conversation

@yitsushi
Copy link
Collaborator

@yitsushi yitsushi commented Sep 11, 2023

fix: controllers/tc00005x tests

Closes #905


fix: reconcile stuck in a loop with manual approval

After a bit of poking, if I remove all changed from the commit, except
the patcher := ... and the patcher.Patch call (so the
finalizeStatus does literally nothing, but patches the "expected
nothing"), it still causes an issue.

If I keep everything from the commit, but move the patcher := line
into the defer function, tests are happy.

We already have status patching everywhere (without this commit
everything worked). The Patcher in this commit should just patch the
diff calculated in finalizeStatus.

I assume it a weird issue how the whole codebase tosses around the
&terraform reference and makes Patch calls somewhere else in the State
Machine.

Closes #890

I disabled 51 and 52 tests as they are failing 100% of the time, it's
not flaky, but we don't know what causes the issue. With manual
approval, it stuck in a loop between "drift detected" and "in progress".
This is a known issue [^1].

Closes #905

Related to #890

[^1]: #890

Signed-off-by: Balazs Nadasdi <balazs@weave.works>
@yitsushi yitsushi marked this pull request as ready for review September 11, 2023 16:39
@yitsushi yitsushi changed the title fix: controllers/tc00005x tests fix: controllers/tc00005x tests and the manual approval stuck in loop bug Sep 11, 2023
After a bit of poking, if I remove all changed from the commit, except
the `patcher := ...` and the `patcher.Patch` call (so the
`finalizeStatus` does literally nothing, but patches the "expected
nothing"), it still causes an issue.

If I keep everything from the commit, but move the `patcher :=` line
into the `defer` function, tests are happy.

We already have status patching everywhere (without this commit
everything worked). The Patcher in this commit should just patch the
diff calculated in finalizeStatus.

I assume it a weird issue how the whole codebase tosses around the
`&terraform` reference and makes Patch calls somewhere else in the State
Machine.

Fixes #890

References:
* #890

Signed-off-by: Balazs Nadasdi <balazs@weave.works>
@yitsushi yitsushi merged commit 3f63e61 into main Sep 12, 2023
@bigkevmcd bigkevmcd deleted the 905-fix-5x-tests branch September 14, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The controller should not perform drift detection if it's triggered by a planning request fix controllers/tc00005x tests

3 participants