Skip to content

Commit

Permalink
add log check to tables iteration error test
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangreco committed Jan 22, 2025
1 parent 0919587 commit 6cbd523
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,18 @@ func TestSchemaTable(t *testing.T) {
require.NoError(t, err)

require.Eventually(t, func() bool {
return collector.Stopped()
return len(lokiClient.Received()) == 1
}, 5*time.Second, 100*time.Millisecond)

collector.Stop()
lokiClient.Stop()

lokiEntries := lokiClient.Received()
for _, entry := range lokiEntries {
require.Equal(t, model.LabelSet{"job": database_observability.JobName}, entry.Labels)
}
require.Equal(t, `level=info msg="schema detected" op="schema_detection" instance="mysql-db" schema="some_schema"`, lokiEntries[0].Line)

err = mock.ExpectationsWereMet()
require.NoError(t, err)
})
Expand Down

0 comments on commit 6cbd523

Please sign in to comment.