Skip to content

Commit

Permalink
fix: allow transitioning to long text (backport #25419) (#25475)
Browse files Browse the repository at this point in the history
* fix: allow transitioning to long text

(cherry picked from commit 02fd017)

* ci: setup ssh if test failed

(cherry picked from commit 0ca0e22)

# Conflicts:
#	.github/workflows/server-tests.yml

* test: fixup timeouts

The tests were failing because they weren't able to complete in 20
seconds. Ugh!

(cherry picked from commit 48c24c7)

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Mar 15, 2024
1 parent aaacc51 commit dbb326e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions frappe/core/doctype/rq_job/test_rq_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from frappe.utils.background_jobs import get_job_status, is_job_enqueued


@timeout(seconds=20)
@timeout(seconds=60)
def wait_for_completion(job: Job):
while True:
if not (job.is_queued or job.is_started):
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_delete_doc(self):
with self.assertRaises(rq_exc.NoSuchJobError):
job.refresh()

@timeout(20)
@timeout
def test_multi_queue_burst_consumption(self):
for _ in range(3):
for q in ["default", "short"]:
Expand All @@ -98,7 +98,7 @@ def test_multi_queue_burst_consumption(self):
_, stderr = execute_in_shell("bench worker --queue short,default --burst", check_exit_code=True)
self.assertIn("quitting", cstr(stderr))

@timeout(20)
@timeout
def test_multi_queue_burst_consumption_worker_pool(self):
for _ in range(3):
for q in ["default", "short"]:
Expand All @@ -109,15 +109,13 @@ def test_multi_queue_burst_consumption_worker_pool(self):
)
self.assertIn("quitting", cstr(stderr))

@timeout(20)
def test_job_id_manual_dedup(self):
job_id = "test_dedup"
job = frappe.enqueue(self.BG_JOB, sleep=5, job_id=job_id)
self.assertTrue(is_job_enqueued(job_id))
self.check_status(job, "finished")
self.assertFalse(is_job_enqueued(job_id))

@timeout(20)
def test_auto_job_dedup(self):
job_id = "test_dedup"
job1 = frappe.enqueue(self.BG_JOB, sleep=2, job_id=job_id, deduplicate=True)
Expand All @@ -131,7 +129,7 @@ def test_auto_job_dedup(self):
job4 = frappe.enqueue(self.BG_JOB, sleep=1, job_id=job_id, deduplicate=True)
self.check_status(job4, "finished")

@timeout(20)
@timeout
def test_enqueue_after_commit(self):
job_id = frappe.generate_hash()

Expand All @@ -151,7 +149,6 @@ def test_enqueue_after_commit(self):
frappe.db.commit()
self.assertIsNone(get_job_status(job_id))

@timeout(20)
def test_memory_usage(self):
if frappe.db.db_type != "mariadb":
return
Expand All @@ -167,7 +164,6 @@ def test_memory_usage(self):
LAST_MEASURED_USAGE = 41
self.assertLessEqual(rss, LAST_MEASURED_USAGE * 1.05, msg)

@timeout(20)
def test_clear_failed_jobs(self):
limit = 10
update_site_config("rq_failed_jobs_limit", limit)
Expand Down
2 changes: 1 addition & 1 deletion frappe/custom/doctype/customize_form/customize_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def is_standard_or_system_generated_field(df):
("Text", "Data"),
("Text", "Text Editor", "Code", "Signature", "HTML Editor"),
("Data", "Select"),
("Text", "Small Text"),
("Text", "Small Text", "Long Text"),
("Text", "Data", "Barcode"),
("Code", "Geolocation"),
("Table", "Table MultiSelect"),
Expand Down

0 comments on commit dbb326e

Please sign in to comment.