public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rubygem-railties] rawhide: Fix random asset precompilation test failures.
Date: Thu, 30 Jul 2026 11:32:45 GMT	[thread overview]
Message-ID: <178541116540.1.10038938233878531101.rpms-rubygem-railties-fc54220217f2@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rubygem-railties
Branch : rawhide
Commit : fc54220217f2804c4e58a63ae9abd2e9daf23879
Author : Vít Ondruch <vondruch@redhat.com>
Date   : 2026-07-30T13:04:27+02:00
Stats  : +57/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-railties/c/fc54220217f2804c4e58a63ae9abd2e9daf23879?branch=rawhide

Log:
Fix random asset precompilation test failures.

---
diff --git a/rubygem-railties-8.1.3-Fix-test_precompile_shouldnt_use_the_digests_present_in_manifest-json-failure.patch b/rubygem-railties-8.1.3-Fix-test_precompile_shouldnt_use_the_digests_present_in_manifest-json-failure.patch
new file mode 100644
index 0000000..a857ff5
--- /dev/null
+++ b/rubygem-railties-8.1.3-Fix-test_precompile_shouldnt_use_the_digests_present_in_manifest-json-failure.patch
@@ -0,0 +1,45 @@
+From a1375572d17f107e9f7f788cceffb59707cb6202 Mon Sep 17 00:00:00 2001
+From: Yasuo Honda <yasuo.honda@gmail.com>
+Date: Fri, 17 Jul 2026 23:04:21 +0900
+Subject: [PATCH] Fix
+ test_precompile_shouldn't_use_the_digests_present_in_manifest.json failure
+
+When this test rewrites app/assets/images/rails.png in the same second
+as the initial write, the second precompile reuses the stale cached
+digest and the application.css digest does not change:
+
+    Expected "application-c56ef81d122dffa8b257b0546ba1b09bd2d8b97e4aef881de8db9f760b903af6.css"
+    to not be equal to "application-c56ef81d122dffa8b257b0546ba1b09bd2d8b97e4aef881de8db9f760b903af6.css".
+
+sprockets caches file digests keyed by the mtime truncated to whole
+seconds (Sprockets::Base#file_digest, rails/sprockets@55c3b563;
+rails/sprockets@2fefbf4e: "fidelity is already hard coded to 1 second
+in lots of other spots").
+
+The two writes are separated only by one precompile run, so the
+failure becomes more likely as the machine gets faster. Observed on CI:
+
+* 2026-07-02 railties (4.0) [rack-3-0]
+  https://buildkite.com/rails/rails/builds/130521#019f24ea-6805-4b97-96a2-f774754cf29e
+* 2026-07-16 railties [rack-2] (nightly)
+  https://buildkite.com/rails/rails-nightly/builds/4552#019f6cba-e4be-4732-b980-bacd627dfc21
+* 2026-07-17 railties (3.3)
+  https://buildkite.com/rails/rails/builds/131149#019f7040-9396-4972-99b7-06deec0012db
+
+Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
+---
+ railties/test/application/sprockets_assets_test.rb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/railties/test/application/sprockets_assets_test.rb b/railties/test/application/sprockets_assets_test.rb
+index 66401e853c455..bd82ddb08dcc6 100644
+--- a/railties/test/application/sprockets_assets_test.rb
++++ b/railties/test/application/sprockets_assets_test.rb
+@@ -314,6 +314,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
+       assets = ActiveSupport::JSON.decode(File.read(manifest))
+       asset_path = assets["assets"]["application.css"]
+ 
++      sleep 1
+       app_file "app/assets/images/rails.png", "p { url: change }"
+ 
+       precompile!

diff --git a/rubygem-railties.spec b/rubygem-railties.spec
index 560cc04..37d2101 100644
--- a/rubygem-railties.spec
+++ b/rubygem-railties.spec
@@ -14,6 +14,14 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
 # git clone http://github.com/rails/rails.git && cd rails/railties
 # git archive -v -o railties-8.1.2-tests.tar.gz v8.1.2 test/
 Source1: %{gem_name}-%{version}%{?prerelease}-tests.tar.gz
+# Fix random test failures:
+# ~~~
+#   1) Failure:
+# ApplicationTests::SprocketsAssetsTest#test_precompile_shouldn't_use_the_digests_present_in_manifest.json [test/application/sprockets_assets_test.rb:322]:
+# Expected "application-c56ef81d122dffa8b257b0546ba1b09bd2d8b97e4aef881de8db9f760b903af6.css" to not be equal to "application-c56ef81d122dffa8b257b0546ba1b09bd2d8b97e4aef881de8db9f760b903af6.css".
+# ~~~
+# https://github.com/rails/rails/pull/58148
+Patch0: rubygem-railties-8.1.3-Fix-test_precompile_shouldnt_use_the_digests_present_in_manifest-json-failure.patch
 
 # dbconsole requires the executable.
 Suggests: %{_bindir}/sqlite3
@@ -87,6 +95,10 @@ Documentation for %{name}.
 %prep
 %setup -q -n %{gem_name}-%{version}%{?prerelease} -b1
 
+( cd %{builddir}
+%patch 0 -p2
+)
+
 %build
 gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
 %gem_install

                 reply	other threads:[~2026-07-30 11:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178541116540.1.10038938233878531101.rpms-rubygem-railties-fc54220217f2@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox