Skip to content

Commit

Permalink
[YottaDB#341] New r124/ydb341 subtest (tests YottaDB/YDB#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
nars1 committed Aug 14, 2018
1 parent f3d0067 commit 27b0a14
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 1 deletion.
36 changes: 36 additions & 0 deletions r124/inref/ydb341.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. ;
; All rights reserved. ;
; ;
; This source code contains the intellectual property ;
; of its copyright holder(s), and is made available ;
; under a license. If you do not know the terms of ;
; the license, please stop and do not read further. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
set jrisave=$$FUNC^%HD($$^%PEEKBYNAME("sgmnt_addrs.gvstats_rec.n_jrec_epoch_idle","DEFAULT"))
write "Perform update SET ^x=1",!
set ^x=1
write "Sleep for 8 seconds to ensure an idle epoch gets written",!
; "hang 8" below takes into account 1 second for flush timer + 5 seconds for idle epoch timer + 2 seconds for buffer
hang 8
write "Confirm an idle epoch did get written : "
set jridelta=$$FUNC^%HD($$^%PEEKBYNAME("sgmnt_addrs.gvstats_rec.n_jrec_epoch_idle","DEFAULT"))-jrisave
write "JRI gvstat increased by ",(jridelta>0),!
write "Perform update SET ^x=2",!
set ^x=2
set jresave=$$FUNC^%HD($$^%PEEKBYNAME("sgmnt_addrs.gvstats_rec.n_jrec_epoch_regular","DEFAULT"))
write "Sleep for anywhere from 1 to 5 seconds",!
hang 1+$random(5)
write "Perform update SET ^x=3",!
set ^x=3
write "Sleep for 1 second",!
hang 1
write "Perform update SET ^x=4",!
set ^x=4
write "Confirm a regular epoch got written in between updates ^x=2 and ^x=4 : "
set jredelta=$$FUNC^%HD($$^%PEEKBYNAME("sgmnt_addrs.gvstats_rec.n_jrec_epoch_regular","DEFAULT"))-jresave
write "JRE gvstat increased by ",(jredelta>0),!
quit
3 changes: 2 additions & 1 deletion r124/instream.csh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# ydb315 [jake] Tests that the ZCOMPILE operation will not display warning if $ZCOMPILE contains "-nowarnings"
# ydb324 [nars] Tests that Error inside indirection usage in direct mode using $ETRAP (not $ZTRAP) does not terminate process
# ydb321 [nars] Tests that journal records fed to external filters include timestamps
# ydb341 [nars] Tests that epoch_interval setting is honored even if an idle epoch is written
#----------------------------------------------------------------------------------------------------------------------------------------------------------

echo "r124 test starts..."
Expand All @@ -39,7 +40,7 @@ echo "r124 test starts..."
setenv subtest_list_common ""
setenv subtest_list_non_replic ""
setenv subtest_list_non_replic "$subtest_list_non_replic readonly ydb275socketpass ydb280socketwait jnlunxpcterr ydb297 ydb315"
setenv subtest_list_non_replic "$subtest_list_non_replic ydb324"
setenv subtest_list_non_replic "$subtest_list_non_replic ydb324 ydb341"
setenv subtest_list_replic ""
setenv subtest_list_replic "$subtest_list_replic ydb282srcsrvrerr ydb293 ydb312_gtm8182a ydb312_gtm8182b ydb312_gtm8182c"
setenv subtest_list_replic "$subtest_list_replic ydb312_gtm8182d ydb312_gtm8182e ydb312_gtm8182f ydb312_gtm8182g ydb321"
Expand Down
1 change: 1 addition & 0 deletions r124/outref/outref.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PASS from ydb297
##ALLOW_OUTPUT HOST_LINUX_ARMVXL
PASS from ydb315
PASS from ydb324
PASS from ydb341
##ALLOW_OUTPUT REPLIC
##SUSPEND_OUTPUT NON_REPLIC
##SUSPEND_OUTPUT PRO
Expand Down
17 changes: 17 additions & 0 deletions r124/outref/ydb341.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ----------------------------------------------------------------------------
# Test that epoch_interval setting is honored even if an idle epoch is written
# ----------------------------------------------------------------------------
# Enable journaling on the database
# Set epoch_interval of 2 seconds
# Create database
# Invoke : mumps -run ydb341
Perform update SET ^x=1
Sleep for 8 seconds to ensure an idle epoch gets written
Confirm an idle epoch did get written : JRI gvstat increased by 1
Perform update SET ^x=2
Sleep for anywhere from 1 to 5 seconds
Perform update SET ^x=3
Sleep for 1 second
Perform update SET ^x=4
Confirm a regular epoch got written in between updates ^x=2 and ^x=4 : JRE gvstat increased by 1
# Do dbcheck on database
39 changes: 39 additions & 0 deletions r124/u_inref/ydb341.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/local/bin/tcsh -f
#################################################################
# #
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
#
echo "# ----------------------------------------------------------------------------"
echo "# Test that epoch_interval setting is honored even if an idle epoch is written"
echo "# ----------------------------------------------------------------------------"
#
echo "# Enable journaling on the database"
setenv gtm_test_jnl SETJNL
echo "# Set epoch_interval of 2 seconds"
setenv tst_jnl_str "$tst_jnl_str,epoch=2"
echo "# Create database"
$gtm_tst/com/dbcreate.csh mumps >& dbcreate.out
if ($status) then
echo "# dbcreate failed. Output of dbcreate.out follows"
cat dbcreate.out
exit -1
endif

echo "# Invoke : mumps -run ydb341"
$ydb_dist/mumps -run ydb341

echo "# Do dbcheck on database"
$gtm_tst/com/dbcheck.csh >& dbcheck.out
if ($status) then
echo "# dbcheck failed. Output of dbcheck.out follows"
cat dbcheck.out
exit -1
endif

0 comments on commit 27b0a14

Please sign in to comment.