Skip to content

test: silence BigQuery IAM/schema noise from background mocks#3550

Open
nelsonmestevao wants to merge 1 commit into
Logflare:mainfrom
nelsonmestevao:ne/mimic-mock-logs-bigquery
Open

test: silence BigQuery IAM/schema noise from background mocks#3550
nelsonmestevao wants to merge 1 commit into
Logflare:mainfrom
nelsonmestevao:ne/mimic-mock-logs-bigquery

Conversation

@nelsonmestevao

Copy link
Copy Markdown
Contributor

Tests were logging (and occasionally failing on) Mimic errors caused by BigQuery calls. By globally stubbing BigQueryAdaptor calls to update_iam_policy/0,1 and patch_dataset_access/1 we reduce the noise.

test "updates correctly" do
prev_config = Application.get_env(:logflare, Schema)
Application.put_env(:logflare, Schema, updates_per_minute: 1)
on_exit(fn -> Application.put_env(:logflare, Schema, prev_config) end)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force updates_per_minute: 1 so the Schema throttle actually engages. With the test config's 900_000, the throttle window is ~0ms, so the second update raced past expect(:bigquery_tables_patch, 1) and crashed the GenServer. This way we avoid flakyness introduced by the crash.

Tests were logging (and occasionally failing on) Mimic errors caused by BigQuery calls. By globally stubbing `BigQueryAdaptor` calls to update_iam_policy/0,1 and patch_dataset_access/1 we reduce the noise.
@nelsonmestevao nelsonmestevao force-pushed the ne/mimic-mock-logs-bigquery branch from 1a05382 to e6bfab2 Compare June 8, 2026 12:36
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.

1 participant