Skip to content

Commit 78d9f17

Browse files
committed
Fix failing test due to false positive
1 parent 00b1b69 commit 78d9f17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

solr/packaging/powershell-tests/Zk.Tests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ BeforeAll {
126126
Write-Host "Testing: $TestName"
127127
Write-Host "Running: $SolrCmd $($Arguments -join ' ')"
128128

129+
# Note that CLI warnings are interpreted as NativeCommandError, since logged to std.err, and therefore may match
130+
# strings like "Error"
129131
$output = & $SolrCmd @Arguments 2>&1
130132
$outputStr = $output | Out-String
131133

@@ -275,7 +277,7 @@ Describe "Solr Zk Command" {
275277
if (Test-Path $sourceConfigsetDir) {
276278
$output = Test-CommandOutput @("zk", "upconfig", "-d", $sourceConfigsetDir, "-n", "techproducts_ps_test", "-z", "localhost:$ZK_PORT") "zk upconfig"
277279
$output | Should -Match "Uploading"
278-
$output | Should -Not -Match "ERROR"
280+
$LASTEXITCODE | Should -Match 0
279281
} else {
280282
Set-ItResult -Skipped -Because "sample_techproducts_configs not found"
281283
}
@@ -290,7 +292,7 @@ Describe "Solr Zk Command" {
290292
try {
291293
$output = Test-CommandOutput @("zk", "downconfig", "-z", "localhost:$ZK_PORT", "-n", "_default", "-d", $downloadDir) "zk downconfig"
292294
$output | Should -Match "Downloading"
293-
$output | Should -Not -Match "ERROR"
295+
$LASTEXITCODE | Should -Match 0
294296
} finally {
295297
# Cleanup
296298
if (Test-Path $downloadDir) {

0 commit comments

Comments
 (0)