WriteConsoleOutputWOutsideBuffer test fails occasionally #1282

Open
opened 2026-01-30 22:20:58 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (May 23, 2019).

@miniksa do you know why this test keeps failing?
https://dev.azure.com/ms/Terminal/_build/results?buildId=16264


Passed   BasicWriteConsoleOutputATest
Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6)
Failed   WriteConsoleOutputWOutsideBuffer
Error Message:
 Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6)
Stack Trace:
at OutputTests::WriteConsoleOutputWOutsideBuffer() in d:\a\1\s\src\host\ft_host\api_outputtests.cpp:line 140
Standard Output Messages:
 Win32BoolSucceeded(CloseHandle(_hConsole)): Removing our test screen buffer.
 Restoring v1/v2 console state to original '1'
 Win32BoolFailed(RegSetValueExW(_consoleKey.get(), pwszForceV2ValueName, 0, REG_DWORD, (LPBYTE)&_dwForceV2Original, sizeof(_dwForceV2Original)))
 AreEqual(ERROR_SUCCESS, lstatus)
 Backing up v1/v2 console state.
 Win32BoolFailed(lstatus): Assert querying ForceV2 key was successful.
 Setting v1/v2 console state to desired '1'
 Win32BoolFailed(RegSetValueExW(_consoleKey.get(), pwszForceV2ValueName, 0, REG_DWORD, (LPBYTE)&ForceV2StateDesired, sizeof(ForceV2StateDesired)))
 SUCCEEDED(RuntimeParameters::TryGetValue(L"TestDeploymentDir", value))
 SUCCEEDED(StringCchCopyW(str, cchNeeded, (WCHAR*)value.GetBuffer()))
 Win32BoolSucceeded(nullptr != hJob)
 Win32BoolSucceeded(SetInformationJobObject(hJob.get(), JobObjectExtendedLimitInformation, &JobLimits, sizeof(JobLimits)))
 Win32BoolSucceeded(CreateProcessW(nullptr, str, nullptr, nullptr, FALSE, CREATE_NEW_CONSOLE | CREATE_SUSPENDED, nullptr, nullptr, &si, pi.addressof()))
 Win32BoolSucceeded(AssignProcessToJobObject(hJob.get(), pi.hProcess))
 Win32BoolSucceeded(-1 != ResumeThread(pi.hThread))
 IsLessThan(dwTotalWait, _dwMaxMillisecondsToWaitOnStartup)
 IsNotNull(pPidList)
 Win32BoolSucceeded(QueryInformationJobObject(hJob.get(), JobObjectBasicProcessIdList, pPidList, cbRequired, nullptr))
 AreEqual(pids.NumberOfAssignedProcesses, pPidList->NumberOfProcessIdsInList)
 AreNotEqual(0u, dwFindPid)
 Win32BoolSucceeded(FreeConsole())
 Win32BoolSucceeded(AttachConsole(dwFindPid))
 AreEqual(0, err)
 AreEqual(0, err)
 AreNotEqual(_hConsole, INVALID_HANDLE_VALUE): Creating our test screen buffer.
 Win32BoolSucceeded(SetConsoleActiveScreenBuffer(_hConsole)): Applying test screen buffer to console
 ***********	WriteConsoleOutputWOutsideBuffer - Test Start		***********
 
 Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6)
 
 ***********	WriteConsoleOutputWOutsideBuffer - Test End		***********
 ***********	WriteConsoleOutputWOutsideBuffer - Test Failed	***********

Originally posted by @zadjii-msft in https://github.com/microsoft/terminal/pull/924#issuecomment-494911471

Originally created by @zadjii-msft on GitHub (May 23, 2019). @miniksa do you know why this test keeps failing? https://dev.azure.com/ms/Terminal/_build/results?buildId=16264 ``` Passed BasicWriteConsoleOutputATest Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6) Failed WriteConsoleOutputWOutsideBuffer Error Message: Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6) Stack Trace: at OutputTests::WriteConsoleOutputWOutsideBuffer() in d:\a\1\s\src\host\ft_host\api_outputtests.cpp:line 140 Standard Output Messages: Win32BoolSucceeded(CloseHandle(_hConsole)): Removing our test screen buffer. Restoring v1/v2 console state to original '1' Win32BoolFailed(RegSetValueExW(_consoleKey.get(), pwszForceV2ValueName, 0, REG_DWORD, (LPBYTE)&_dwForceV2Original, sizeof(_dwForceV2Original))) AreEqual(ERROR_SUCCESS, lstatus) Backing up v1/v2 console state. Win32BoolFailed(lstatus): Assert querying ForceV2 key was successful. Setting v1/v2 console state to desired '1' Win32BoolFailed(RegSetValueExW(_consoleKey.get(), pwszForceV2ValueName, 0, REG_DWORD, (LPBYTE)&ForceV2StateDesired, sizeof(ForceV2StateDesired))) SUCCEEDED(RuntimeParameters::TryGetValue(L"TestDeploymentDir", value)) SUCCEEDED(StringCchCopyW(str, cchNeeded, (WCHAR*)value.GetBuffer())) Win32BoolSucceeded(nullptr != hJob) Win32BoolSucceeded(SetInformationJobObject(hJob.get(), JobObjectExtendedLimitInformation, &JobLimits, sizeof(JobLimits))) Win32BoolSucceeded(CreateProcessW(nullptr, str, nullptr, nullptr, FALSE, CREATE_NEW_CONSOLE | CREATE_SUSPENDED, nullptr, nullptr, &si, pi.addressof())) Win32BoolSucceeded(AssignProcessToJobObject(hJob.get(), pi.hProcess)) Win32BoolSucceeded(-1 != ResumeThread(pi.hThread)) IsLessThan(dwTotalWait, _dwMaxMillisecondsToWaitOnStartup) IsNotNull(pPidList) Win32BoolSucceeded(QueryInformationJobObject(hJob.get(), JobObjectBasicProcessIdList, pPidList, cbRequired, nullptr)) AreEqual(pids.NumberOfAssignedProcesses, pPidList->NumberOfProcessIdsInList) AreNotEqual(0u, dwFindPid) Win32BoolSucceeded(FreeConsole()) Win32BoolSucceeded(AttachConsole(dwFindPid)) AreEqual(0, err) AreEqual(0, err) AreNotEqual(_hConsole, INVALID_HANDLE_VALUE): Creating our test screen buffer. Win32BoolSucceeded(SetConsoleActiveScreenBuffer(_hConsole)): Applying test screen buffer to console *********** WriteConsoleOutputWOutsideBuffer - Test Start *********** Win32BoolSucceeded(SetConsoleWindowInfo(consoleOutputHandle, true, &window)) - Value (6) *********** WriteConsoleOutputWOutsideBuffer - Test End *********** *********** WriteConsoleOutputWOutsideBuffer - Test Failed *********** ``` _Originally posted by @zadjii-msft in https://github.com/microsoft/terminal/pull/924#issuecomment-494911471_
claunia added the Help WantedProduct-ConhostIssue-BugNeeds-Tag-FixArea-Build labels 2026-01-30 22:20:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1282