qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請訪問 http://qaseven.github.io/

          LoadRunner 常見錯誤收集及解決方案

           一. This Vuser already started a transaction with the same name, and has not yet processed the corresponding lr_end_transaction statement.
            在做性能測試的時候,有時候會遇到下面的錯誤:This Vuser already started a transaction with the same name, and has not yet processed the corresponding lr_end_transaction statement.
            解釋:就是腳本中有一個事物開始了,但是沒有結(jié)束事物,此時loadrunner就會報錯,因為開始和結(jié)束是一一對應(yīng)的,誰也不能把它們拆開,拆開了就會報錯。
            異常再現(xiàn):
            下列代碼中,如果業(yè)務(wù)方法報了異常(Throw Exception),那么下面的if判斷的代碼不會被執(zhí)行,而直接跳到catch子句里,那么已經(jīng)開始的業(yè)務(wù)"searchItemList_man"就沒有被結(jié)束,當(dāng)你再次開始業(yè)務(wù)時,就會報錯~
          1 public int action() throws Throwable {
          2
          3         misc = generateManItemSearchCondition();
          4                 lr.start_transaction("searchItemList_man");
          5         try {
          6             //業(yè)務(wù)方法
          7             items = searchService.searchItemList(misc);
          8             if (items.isSuccess()) {
          9                 lr.end_transaction("searchItemList_man",lr.PASS);
          10
          11             } else {
          12                 lr.end_transaction("searchItemList_man",lr.FAIL);
          13             }
          14             orderMap.clear();
          15             productIdSet.clear();
          16             productStatusList.clear();
          17         } catch (Exception e) {
          18
          19
          20             e.printStackTrace();
          21         }
          22
          23
          24         misc = null;
          25         items = null;
          26         return 0;
          27     }//end of action
            解決辦法:  在catch字句里加上一個 事務(wù)結(jié)束代碼,修改后的catch段代碼如下:
          catch (Exception e) {
          // TODO Auto-generated catch block
          lr.end_transaction("searchItemList_man",lr.FAIL);
          e.printStackTrace();
          }
           二.Function two_way_comm_post_message / two_way_comm_post_message_ex failed錯誤
            在Controller里運行腳本,運行一段時間以后出現(xiàn)如下error messages。
            1. Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post_message / two_way_comm_post_message_ex failed.
            2. Code - 29739 Error: Service client with id=1 failed to post a message, reason - communication error.
            3. Code - 16895 Error: Failed to post xdr buffers data array by post_ex.
            4. Code - 10343 Error: Communication error: Cannot send the message since reached the shared memory buffer max size.
            問題誘因1:
            共享內(nèi)存緩存溢出,造成Controller和Load Generator之間通訊出現(xiàn)問題。
            解決方案:
            修改兩個配置文件。
            1. $installation folder$\dat\channel_configure.dat
            2. $installation folder$\launch_service\dat\channel_configure.dat
            在這兩個文件中的[general]部分下添加如下配置。
            shared_memory_max_size=100 (修改共享內(nèi)存為100MB,默認是50MB)
            重新啟動Controller,問題解決。
            問題誘因2
            打開 controller中的 diagnostics菜單,點掉復(fù)選框.. 步驟如下圖
            1.
            2. 點掉 Enable the following diagnostics
            3. 整理了一下 這個功能是干么滴:
            當(dāng)場景中打開 Diagnostics 菜單下 Web Page Diagnostics 功能后, 才能得到網(wǎng)頁分析組圖。
            通過該圖, 可以對事務(wù)的組成進行抽絲剝繭的分析, 得到組成這個頁面的每一個請求的時間分析, 進 一步了解響應(yīng)時間中有關(guān)網(wǎng)絡(luò)和服務(wù)器處理時間的分配關(guān)系。
            可以實現(xiàn)對網(wǎng)站的前端性能分析, 明確系統(tǒng)響應(yīng)時間較長是由服務(wù)器端處理能力不足還是客戶端鏈接 到服務(wù)器的網(wǎng)絡(luò)消耗導(dǎo)致的。
            三. Fatal Error -26000: Not enough memory (12320 bytes) for "new buffer in LrwSrvNetTaskIt 問題解決及l(fā)r腳本心得
            現(xiàn)象: 用loadrunner跑場景的時候報錯:
            Action.c(28): Fatal Error -26000: Not enough memory (12320 bytes) for "new buffer in LrwSrvNetTaskItem::AllocSrvNetBuf". Aborting 的錯誤,
            同時任務(wù)管理器里mmdrv.exe 內(nèi)存占用一直增大,最終mmdrv.exe崩潰. 網(wǎng)上有人認為是 lr的 emulation browser設(shè)置問題,最后發(fā)現(xiàn)系腳本問題,原腳本聲明了好幾個變量,而且都未使用:
          1 Action()
          2 {
          3
          4          //返回的字符串
          5     char resp_txt[200] = {0};
          6     //寫入流的數(shù)據(jù)
          7     long myfile;
          8     //當(dāng)前日期時間
          9     long now;
          10    .....
          11    ......
          12
          13     return 0;
          14 }
            解決方法及總結(jié):
            后將此三個變量注釋之后問題解決.
            結(jié)論:LR的腳本要注意內(nèi)存的使用,盡量減少變量聲明,對于char類型的變量要及時用free:即:
            1  char * a;
            2  free (a);

          posted on 2014-04-02 11:04 順其自然EVO 閱讀(11080) 評論(0)  編輯  收藏 所屬分類: 測試學(xué)習(xí)專欄

          <2014年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 昭苏县| 额济纳旗| 淅川县| 突泉县| 九寨沟县| 咸宁市| 义马市| 凌海市| 襄城县| 察隅县| 北安市| 鹰潭市| 衡山县| 江津市| 攀枝花市| 哈巴河县| 长乐市| 秦安县| 潼关县| 察哈| 加查县| 黔西| 丽江市| 安阳县| 新沂市| 左贡县| 揭阳市| 红安县| 朝阳市| 连平县| 密云县| 汉川市| 洛川县| 如东县| 永兴县| 吴忠市| 嘉荫县| 英山县| 衡东县| 黄大仙区| 长治县|