Fixed bug in Eventhubs live tests (#5290)
* Fixed bug in Eventhubs live tests * switched back to DAC for tests
This commit is contained in:
Родитель
4820c4f999
Коммит
76c82f0b9e
|
@ -58,8 +58,11 @@ namespace Azure { namespace Messaging { namespace EventHubs {
|
|||
/// Returns the partition ID associated with this ProcessorPartitionClient.
|
||||
std::string PartitionId() const { return m_partitionId; }
|
||||
|
||||
/** Closes the partition client. */
|
||||
void Close(Core::Context const& context)
|
||||
/** @brief Closes the partition client.
|
||||
*
|
||||
* @param context The context to pass to the close operation.
|
||||
*/
|
||||
void Close(Core::Context const& context = {})
|
||||
{
|
||||
if (m_cleanupFunc)
|
||||
{
|
||||
|
|
|
@ -48,35 +48,6 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
std::move(perCallpolicies));
|
||||
}
|
||||
|
||||
Azure::Core::Json::_internal::json ParseAzureCliOutput(std::string const& cliOutput)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "Azure CLI output: " << cliOutput;
|
||||
std::string jsonOutput = cliOutput;
|
||||
if (jsonOutput.find("WARNING:") == 0)
|
||||
{
|
||||
// Erase the warning from the CLI.
|
||||
jsonOutput = jsonOutput.erase(0, cliOutput.find('\n') + 1);
|
||||
}
|
||||
if (jsonOutput.find("DEBUG:") == 0)
|
||||
{
|
||||
// Erase the warning from the CLI.
|
||||
GTEST_LOG_(WARNING) << "Azure CLI debug output: " << jsonOutput;
|
||||
jsonOutput = jsonOutput.erase(0, cliOutput.find('\n') + 1);
|
||||
}
|
||||
if (jsonOutput.find("ERROR:") == 0)
|
||||
{
|
||||
throw std::runtime_error("Error processing Azure CLI: " + jsonOutput);
|
||||
}
|
||||
if (jsonOutput.empty())
|
||||
{
|
||||
return {};
|
||||
}
|
||||
else
|
||||
{
|
||||
return Azure::Core::Json::_internal::json::parse(jsonOutput);
|
||||
}
|
||||
}
|
||||
|
||||
EventHubsManagement::EventHubsCreateOrUpdateOperation EventHubsManagement::CreateNamespace(
|
||||
std::string const& namespaceName,
|
||||
EventHubsPricingTier pricingTier,
|
||||
|
|
|
@ -581,12 +581,17 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
while (!partitionClients.empty())
|
||||
{
|
||||
auto partitionClientIterator = partitionClients.begin();
|
||||
auto partitionClient = partitionClientIterator->second;
|
||||
std::shared_ptr<ProcessorPartitionClient> partitionClient;
|
||||
if (partitionClientIterator != partitionClients.end())
|
||||
{
|
||||
partitionClient = partitionClientIterator->second;
|
||||
partitionClients.erase(partitionClientIterator);
|
||||
}
|
||||
partitionClient->Close(context);
|
||||
// Don't re-use the context variable here, because it's been canceled.
|
||||
if (partitionClient)
|
||||
{
|
||||
partitionClient->Close();
|
||||
}
|
||||
}
|
||||
|
||||
processor.Stop();
|
||||
|
|
Загрузка…
Ссылка в новой задаче