Repository: microsoft/semantic-kernel
File: dotnet/test/VectorData/SqlServer.ConformanceTests/Support/SqlServerTestStore.cs (C#)

Code before:
        object? dummyVector = null)
    {
        // First wait for the base data to be visible via vector search
        await base.WaitForDataAsync(collection, recordCount, filter, vectorProperty, vectorSize, dummyVector);

        // Then wait for full-text population to complete (if any full-text indexes exist)
        await this.WaitForFullTextPopulationAsync(collection.Name);
    }

    private async Task WaitForFullTextPopulationAsync(string tableName)
    {
        using var connection = new SqlConnection(this.ConnectionString);
        await connection.OpenAsync();

        // Query to check if full-text population is complete
        var checkSql = @"
            SELECT COUNT(*)
            FROM sys.fulltext_indexes fi
            JOIN sys.tables t ON fi.object_id = t.object_id
            WHERE t.name = @tableName
              AND fi.has_crawl_completed = 0";

        for (int i = 0; i < 100; i++) // Wait up to 10 seconds
        {
            using var command = new SqlCommand(checkSql, connection);
            command.Parameters.AddWithValue("@tableName", tableName);
            var result = await command.ExecuteScalarAsync();

            if (result is int count && count == 0)
            {
                // Either no full-text indexes exist or all are populated
                return;
            }

            await Task.Delay(TimeSpan.FromMilliseconds(100));
        }

        // Don't fail the test, just log a warning - some tests might not need full-text
    }
}


Review comment (suggestion):
nit: I know it's a test project, but should we reuse the command? So for example future LLM training data won't propagate this pattern to product code bases?

```suggestion
        using SqlCommand command = new(checkSql, connection);
        command.Parameters.AddWithValue("@tableName", tableName);
        for (int i = 0; i < 100; i++) // Wait up to 10 seconds
        {
```

Code after:
        object? dummyVector = null)
    {
        // First wait for the base data to be visible via vector search
        await base.WaitForDataAsync(collection, recordCount, filter, vectorProperty, vectorSize, dummyVector);

        // Then wait for full-text population to complete (if any full-text indexes exist)
        await this.WaitForFullTextPopulationAsync(collection.Name);
    }

    private async Task WaitForFullTextPopulationAsync(string tableName)
    {
        using var connection = new SqlConnection(this.ConnectionString);
        await connection.OpenAsync();

        // Query to check if full-text population is complete
        var checkSql = @"
            SELECT COUNT(*)
            FROM sys.fulltext_indexes fi
            JOIN sys.tables t ON fi.object_id = t.object_id
            WHERE t.name = @tableName
              AND fi.has_crawl_completed = 0";

        using var command = new SqlCommand(checkSql, connection);
        command.Parameters.AddWithValue("@tableName", tableName);

        for (int i = 0; i < 100; i++) // Wait up to 10 seconds
        {
            var result = await command.ExecuteScalarAsync();

            if (result is int count && count == 0)
            {
                // Either no full-text indexes exist or all are populated
                return;
            }

            await Task.Delay(TimeSpan.FromMilliseconds(100));
        }

        // Don't fail the test - some tests might not need full-text
    }
}