Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid warning during lua unit test #4313

Merged
merged 1 commit into from
Jul 11, 2019
Merged

avoid warning during lua unit test #4313

merged 1 commit into from
Jul 11, 2019

Conversation

ElvinEfendi
Copy link
Member

What this PR does / why we need it:
This is to avoid warning messages during Lua test runs such as:

2019/07/11 22:22:31 [warn] 118#118: *2 [lua] _G write guard:12: __newindex(): writing a global lua variable ('_TEST') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
	./rootfs/etc/nginx/lua/test/balancer_test.lua:1: in main chunk
	[C]: in function 'xpcall'
	/usr/local/openresty/luajit/share/lua/5.1/busted/core.lua:178: in function 'safe'
	/usr/local/openresty/luajit/share/lua/5.1/busted/block.lua:146: in function 'execute'
	/usr/local/openresty/luajit/share/lua/5.1/busted/init.lua:7: in function 'executor'
	/usr/local/openresty/luajit/share/lua/5.1/busted/core.lua:312: in function </usr/local/openresty/luajit/share/lua/5.1/busted/core.lua:312>
	[C]: in function 'xpcall'
	/usr/local/openresty/luajit/share/lua/5.1/busted/core.lua:178: in function 'safe'
	/usr/local/openresty/luajit/share/lua/5.1/busted/core.lua:312: in function 'execute'
	.../local/openresty/luajit/share/lua/5.1/busted/execute.lua:58: in function 'execute'
	/usr/local/openresty/luajit/share/lua/5.1/busted/runner.lua:197: in function </usr/local/openresty/luajit/share/lua/5.1/busted/runner.lua:11>
	./rootfs/etc/nginx/lua/test/run.lua:38: in function 'file_gen'
	init_worker_by_lua:58: in function <init_worker_by_lua:56>
	[C]: in function 'xpcall'
	init_worker_by_lua:65: in function <init_worker_by_lua:63>, context: ngx.timer

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 11, 2019
@k8s-ci-robot k8s-ci-robot requested review from aledbf and bowei July 11, 2019 22:23
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 11, 2019
@aledbf
Copy link
Member

aledbf commented Jul 11, 2019

/test pull-ingress-nginx-test

@aledbf
Copy link
Member

aledbf commented Jul 11, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@fe6c086). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4313   +/-   ##
=========================================
  Coverage          ?   58.33%           
=========================================
  Files             ?       87           
  Lines             ?     6478           
  Branches          ?        0           
=========================================
  Hits              ?     3779           
  Misses            ?     2273           
  Partials          ?      426

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe6c086...b424ad2. Read the comment docs.

@k8s-ci-robot k8s-ci-robot merged commit 33d8957 into kubernetes:master Jul 11, 2019
@ElvinEfendi ElvinEfendi deleted the lua-test-improvements branch July 13, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants