From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id DE89664ED28; Thu, 9 Nov 2023 16:45:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DE89664ED28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1699537557; bh=p/6Y/3Lg6VfitZRRgdm+dzIi9NmxQtAp545/pOq6nRk=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=hiI4JFj/5xy3sd/KxEm+xqRkZPnDbc5z2q0cog9QM+RXcT3AeNJ2PkFk7506XIbJD 6KdiDcS4yXCFHr8FINWy0u6qG9CZjsGqF6sImOxfWlelCqfEDl+7pUHsTPEDEUH4Gc TSigyccG5gVcllBV/VcSvEqkrz3/izQ1sqAaOwS4= Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 069C864ED28 for ; Thu, 9 Nov 2023 16:45:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 069C864ED28 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-507a0907896so1035742e87.2 for ; Thu, 09 Nov 2023 05:45:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699537554; x=1700142354; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vXKxZgaizguJDPJ9ApdsL6GP4JqSU+dyZ0wF7q6FXLA=; b=I9Ge1pcn22SEBFgLfSB2twJU/tLjYg6TWLqcBRoapQ9DVEMp9JIDrx6mD52yM46N6I p4N4dlBdmlDxeJAd6L7Ico/viPEGqh8ZslLD7qiVlm+pMjKPo2Ss/dmoBhXFKGpiBSRi bVrmxpMLJPv4iESidN+ieCd/M+95YxcSh7QZ8xrGDhNGkbgHmUysZMuafw3/uLnkoYBz 1FocA1myYMAnEVOI1cLLKUNSof8UKlrDgGjCoA9cVQO5U9YU8X7VQ0W1b8KbHD87xpQq rC4X3Rewcf0aEvYxgvAqc88C2iEAVpTu49OK/FLPIstQhNl46+weGJ4oxG3qm8o2E/eZ sQqw== X-Gm-Message-State: AOJu0YziqbK3pmmTNNMz79ODaczeLew/WZOt9N6tjMhAvGV+H+6k0tlf d/lDD5RAjTOSM4WY/3nP0iblbmfCh8gVl/leFZA= X-Google-Smtp-Source: AGHT+IGbHCF2J4/Cnv2GjOB6KW6XJX8cnl5pJq3Ya2IjtpNx1Id4o3OIek/0HY2ORegQHluIKbiJcw== X-Received: by 2002:ac2:5292:0:b0:507:aaa4:e3b3 with SMTP id q18-20020ac25292000000b00507aaa4e3b3mr1581644lfm.50.1699537553725; Thu, 09 Nov 2023 05:45:53 -0800 (PST) Received: from localhost.localdomain ([185.205.79.42]) by smtp.gmail.com with ESMTPSA id y3-20020ac255a3000000b004fe10276bbfsm1064937lfg.296.2023.11.09.05.45.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 09 Nov 2023 05:45:53 -0800 (PST) To: tarantool-patches@dev.tarantool.org, sergeyb@tarantool.org, skaplun@tarantool.org, m.kokryashkin@tarantool.org Cc: Maksim Kokryashkin Date: Thu, 9 Nov 2023 16:45:49 +0300 Message-Id: <20231109134549.4905-1-max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v2] test: fix flaky OOM error frame test X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Maksim Kokryashkin via Tarantool-patches Reply-To: Maksim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This test could do allocation outside of the protected frame, which could result in an uncaught OOM and test failure. This patch adds extra `collectgarbage` calls to the test to avoid such situations. --- Changes in v2: - Fixed comments as per review by Sergey Kaplun Branch: https://github.com/tarantool/luajit/tree/fckxorg/lj-1004-fix-flaky PR: https://github.com/tarantool/tarantool/pull/9318 test/tarantool-tests/lj-1004-oom-error-frame.test.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/tarantool-tests/lj-1004-oom-error-frame.test.lua b/test/tarantool-tests/lj-1004-oom-error-frame.test.lua index 3be6b555..2ddb5765 100644 --- a/test/tarantool-tests/lj-1004-oom-error-frame.test.lua +++ b/test/tarantool-tests/lj-1004-oom-error-frame.test.lua @@ -10,6 +10,8 @@ test:plan(2) local testoomframe = require('testoomframe') +collectgarbage() + local anchor_memory = {} -- luacheck: no unused local function eatchunks(size) while true do @@ -34,6 +36,11 @@ local function chomp() end local st, err = pcall(chomp) + +-- Prevent OOM outside of the protected frame. +anchor_memory = nil +collectgarbage() + test:ok(st == false, 'on-trace error handled successfully') test:like(err, 'not enough memory', 'error is OOM') test:done(true) -- 2.39.3 (Apple Git-145)