Skip to content

Commit eb536fa

Browse files
committed
fix(tests): seed reorder folders outside Q_ASSERT (stripped in Release CI)
The real cause of the CI-only test_two_columns_node_explorer_sort failure (NOT a reorder race). bringUpExplorer wrapped the seed createFolder/createFile calls inside Q_ASSERT(!...isEmpty()). CI builds Release (CMAKE_BUILD_TYPE defaults to Release in the root CMakeLists; ci-win.yml passes -DCMAKE_BUILD_TYPE=Release), where QT_NO_DEBUG strips Q_ASSERT together with its argument expression. The seeding was therefore compiled out on Linux/Windows CI, leaving the notebook empty; the subsequent reorder saw SetChildrenOrder current=0 vs submitted=2 -> VXCORE_ERR_PERMUTATION_MISMATCH -> reorderCompleted(false) -> errorOccurred (never nodesReordered) -> reorderedSpy.wait(5000) timed out. Green in local Debug and on macOS (built with assertions), red on Release CI. Confirmed from instrumented CI logs: zero createFolder calls before the reorder, cache_size=1 with an empty root config. Move the four seed calls to unconditional statements; keep a Q_ASSERT sanity check on the stored ids (Q_UNUSED to avoid Release unused-variable warnings). Also restores the vxcore submodule pointer to a clean (non-instrumented) commit after the diagnostic build.
1 parent 0f4d553 commit eb536fa

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

libs/vxcore

tests/widgets/test_two_columns_node_explorer_sort.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,24 @@ TwoColumnsNodeExplorer *TestTwoColumnsNodeExplorerSort::bringUpExplorer() {
155155
m_nbId = m_notebookSvc->createNotebook(nbPath, cfg, NotebookType::Bundled);
156156
Q_ASSERT(!m_nbId.isEmpty());
157157

158-
Q_ASSERT(!m_notebookSvc->createFolder(m_nbId, QString(), QStringLiteral("alpha")).isEmpty());
159-
Q_ASSERT(!m_notebookSvc->createFolder(m_nbId, QString(), QStringLiteral("beta")).isEmpty());
160-
Q_ASSERT(!m_notebookSvc->createFile(m_nbId, QString(), QStringLiteral("one.md")).isEmpty());
161-
Q_ASSERT(!m_notebookSvc->createFile(m_nbId, QString(), QStringLiteral("two.md")).isEmpty());
158+
// Seed folders + files. CRITICAL: these calls MUST be unconditional and
159+
// MUST NOT be wrapped in Q_ASSERT. CI builds Release (CMAKE_BUILD_TYPE
160+
// defaults to Release in the root CMakeLists, and ci-win.yml passes
161+
// -DCMAKE_BUILD_TYPE=Release explicitly), where QT_NO_DEBUG strips Q_ASSERT
162+
// TOGETHER WITH its argument expression. The previous
163+
// Q_ASSERT(!create...().isEmpty()) form therefore compiled the seeding OUT
164+
// entirely in Release, leaving the notebook empty so the subsequent reorder
165+
// observed current=0 -> VXCORE_ERR_PERMUTATION_MISMATCH and timed out
166+
// (green in local Debug, red on Linux/Windows CI).
167+
const QString alphaId = m_notebookSvc->createFolder(m_nbId, QString(), QStringLiteral("alpha"));
168+
const QString betaId = m_notebookSvc->createFolder(m_nbId, QString(), QStringLiteral("beta"));
169+
const QString oneId = m_notebookSvc->createFile(m_nbId, QString(), QStringLiteral("one.md"));
170+
const QString twoId = m_notebookSvc->createFile(m_nbId, QString(), QStringLiteral("two.md"));
171+
Q_ASSERT(!alphaId.isEmpty() && !betaId.isEmpty() && !oneId.isEmpty() && !twoId.isEmpty());
172+
Q_UNUSED(alphaId);
173+
Q_UNUSED(betaId);
174+
Q_UNUSED(oneId);
175+
Q_UNUSED(twoId);
162176

163177
auto *explorer = new TwoColumnsNodeExplorer(*m_services);
164178
explorer->setNotebookId(m_nbId);

0 commit comments

Comments
 (0)