SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Icon review: test that a same-size edit with the same timestamp changes the revision (CI flake) (#3375)
Karl Von Richter4a680d17bae7
diff --git a/tests/tools/test_icon_review.py b/tests/tools/test_icon_review.pyindex b6e93d40b3..b3d27d9b57 100644--- a/tests/tools/test_icon_review.py+++ b/tests/tools/test_icon_review.py@@ -296,6 +296,21 @@ class IconReviewTest(unittest.TestCase):self.assertIn('box', get('/api/review')['final'])self.assertNotEqual(old_hash, json.loads((design / 'review.json').read_text(encoding='utf-8'))['final']['box'])+ def test_a_same_size_edit_with_the_same_timestamp_still_changes_the_revision(self):+ # CI VMs can stamp two quick same-size writes with one modification time; the stale page+ # must still be refused (it once accepted changed art there).+ with review_fixture() as (root, design, get, post):+ box = design / 'svg/model/box.svg'+ box.write_text(SVG.replace('r="20"', 'r="18"'), encoding='utf-8')+ stamp = box.stat().st_mtime_ns+ changed = get('/api/review')+ box.write_text(SVG.replace('r="20"', 'r="17"'), encoding='utf-8')+ os.utime(box, ns=(stamp, stamp))+ self.assertNotEqual(changed['rev'], get('/api/review')['rev'])+ with self.assertRaises(urllib.error.HTTPError) as error:+ post(changed, final=['box'])+ self.assertEqual(error.exception.code, 400)+def test_missing_art_is_visible_but_cannot_be_accepted(self):with review_fixture() as (root, design, get, post):commands = root / 'crates/engine/src/cmd'