DEVPROD-13428: Reset Amboy database in e2e tests when mutations enqueue jobs #616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DEVPROD-13428
Description
Why does the test fail?
The tests in
host_buttons.ts
fail because the host is sometimes in a decommissioned state. You cannot reprovision or restart Jasper for a decommissioned host.But the host i-0d0ae8b83366d22be is defined as "running" in the local test data. That shouldn't happen.
True, it seems like this should be impossible because the database should reset after every test that executes a mutation.
What is happening then?
In all of the test failures linked in the corresponding JIRA ticket, the test that runs directly before is
host_update_status.ts
. This test calls a mutation that creates a job in Amboy called EnqueueTerminateHostJob.I think the test was flaky due to a race condition. The two patterns would be:
I think that clearing the Amboy database will help avoid future occurrences of similar bugs. By removing newly enqueued jobs from the Amboy database, we can ensure that the data will not change after we reset the Evergreen database.