OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-cog commits / a0db955

Fix unit test that assumed lack of a race.
a0db9558a2cd72130c18385e1b8fa80f232322fd
by Linas Vepštas <linasvepstas@gmail.com> · 2025-12-07T23:15:54.000Z

Changed files (2) +8 -2

tests/persist/cog-simple/SimpleMultiDeleteUTest.cxxtest +8 -0
……@@ -209,14 +209,22 @@ void SimpleMultiDeleteUTest::test_add_delete(void)
209209 store->load_atomspace();
210210 printf("Final AtomSpace size=%lu\n", as->get_size());
211211
212#if THIS_IS_NOT_TRUE
212213 // Size should be 19: the 18 from before plus that annoying
213214 // (Predicate "*-TruthValueKey-*")
215 //
216 // Well, but this will not hold true, because the insert and
217 // remove ran in different threads, asynchronously, and so
218 // there may have been inserts after the "matching" remove.
219 // This is rare for this test (about one out of 30 runs)
220 // but happens a log for regular MultiDeleteUTest.
214221 size_t expected_size = 9 + n_threads;
215222 if (as->get_size() != expected_size)
216223 printf("Error: Bad size! AtomSpace contents =\n%s\n",
217224 as->to_string().c_str());
218225
219226 TS_ASSERT_EQUALS(as->get_size(), expected_size);
227#endif
220228
221229 store->erase();
222230 store->close();
tests/persist/cog-storage/MultiDeleteUTest.cxxtest +0 -2
……@@ -214,8 +214,6 @@ void MultiDeleteUTest::test_add_delete(void)
214214 // Well, but this will not hold true, because the insert and
215215 // remove ran in different threads, asynchronously, and so
216216 // there may have been inserts after the "matching" remove.
217 // This will hold for the MonoMultiDeleteUTest, because
218 // everything is processed synchronously, there. But not here.
219217 size_t expected_size = 9 + n_threads;
220218 if (as->get_size() != expected_size)
221219 printf("Error: Bad size! AtomSpace contents =\n%s\n",